So I will do my best to write this out.
Currently, I have a VBA loop that filters a range of cells looking for a color and then stores that cell reference. After that, I loop backward through the array inserting a row above it.
I now I need to add into the loop a math equation which will locate column Q in Rows(visibleRowNumbers(i)). Insert the equation Roundup(Cells((i),"Q").offset(-1,)/Sum(Q(i).offset(-2,1):Q(i).offset(-1,5))/6),2)
I know this is improper syntax but I am a novice VBA programmer at best so this is how I am trying to explain it.
Let me also try to explain this verbally in hopes for an outcome.
As I loop backward through the array I also use that stored row value to move out to column Q and add this formula "Roundup(Q34/Sum(R35:W36)/6),2)". I will then copy this formula horizontally all the way to column AQ. Remember.. In the equation above I am going to be using (i) as the row number but the column labels are accurate.
Any advice or help would be greatly appreciated.
Currently, I have a VBA loop that filters a range of cells looking for a color and then stores that cell reference. After that, I loop backward through the array inserting a row above it.
Code:
For i = UBound(visibleRowNumbers) To 0 Step -1 .Rows(visibleRowNumbers(i)).EntireRow.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromRightOrBelow 'xlFormatFromLeftOrAbove
Next
I now I need to add into the loop a math equation which will locate column Q in Rows(visibleRowNumbers(i)). Insert the equation Roundup(Cells((i),"Q").offset(-1,)/Sum(Q(i).offset(-2,1):Q(i).offset(-1,5))/6),2)
I know this is improper syntax but I am a novice VBA programmer at best so this is how I am trying to explain it.
Let me also try to explain this verbally in hopes for an outcome.
As I loop backward through the array I also use that stored row value to move out to column Q and add this formula "Roundup(Q34/Sum(R35:W36)/6),2)". I will then copy this formula horizontally all the way to column AQ. Remember.. In the equation above I am going to be using (i) as the row number but the column labels are accurate.
Any advice or help would be greatly appreciated.