alex_santaana
New Member
- Joined
- May 4, 2017
- Messages
- 1
Good Morning Everyone!
I'm about 4 months into learning VBA so I'm still a beginner. I am trying to write a code and I'll do my best to explain what I'm trying to do. I have a worksheet with multiple columns of financial data going down the columns (In this case columns C,E,G,I,K....). Next to each column of financial data is a blank space where I will calculate the value to the left as a percentage of the overall values of that column. Once that is done, I want the loop to go two columns over and perform the actions again. This needs to be dynamic as reports have different number of rows and columns.
My logic is to create a loop within a loop that is able to start at the first occurrence of financial data in the first column, calculate each row of data until the final row at which point the inner loop would end triggering the outer loop to move to the next column and perform the inner loop again.
I am having a lot of trouble finding an answer for how to do this, specifically how to do a for loop within a for loop. I keep getting errors on my "Next" statement saying there is no "For". Any and all help will be greatly appreciated. Thanks everyone.
I'm about 4 months into learning VBA so I'm still a beginner. I am trying to write a code and I'll do my best to explain what I'm trying to do. I have a worksheet with multiple columns of financial data going down the columns (In this case columns C,E,G,I,K....). Next to each column of financial data is a blank space where I will calculate the value to the left as a percentage of the overall values of that column. Once that is done, I want the loop to go two columns over and perform the actions again. This needs to be dynamic as reports have different number of rows and columns.
My logic is to create a loop within a loop that is able to start at the first occurrence of financial data in the first column, calculate each row of data until the final row at which point the inner loop would end triggering the outer loop to move to the next column and perform the inner loop again.
I am having a lot of trouble finding an answer for how to do this, specifically how to do a for loop within a for loop. I keep getting errors on my "Next" statement saying there is no "For". Any and all help will be greatly appreciated. Thanks everyone.