Understanding How to Write Loop Processing for VBA

Asked 2 years ago, Updated 2 years ago, 342 views

I'm working on an annual cash flow chart in my VBA.

When I press the update button, I want the loop processing to input the value every month.
Also, I have already created an expression for entering a value, so I would like to call it when entering it in a loop.(Name of expression: InputCalc)

Items in expenditure and gross profit may increase.
i is a loop to distinguish between expenditure and gross profit, and j is a loop to enter values in Call.
I don't know how to set the code, so please let me know…

SubButton1_Click()

With Sheets ("HOME")

Dimi As Integer
Dim j As Integer

Fori=7 To.Cells (Rows.Count, 1).End(xlUp).Row

End With

End Sub 

Enter a description of the image here

vba

2022-09-30 21:50

1 Answers

Are there any plans to increase the number of items such as net income other than expenditure and gross profit?
If you don't need it, you can loop i twice.
If yes,
to find the loop value of i Column A Line 7 Follow the transition to the last line, count the number of title characters, and find the number of loops in i.

Inside the loop, look for the presence or absence of characters from the seventh line of column B to the bottom, and look for the number until they are gone. Find the number of loops in j.

I think you should do it like that.


2022-09-30 21:50

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.