I need to divide each integer in a table by the last one in each column, iterating through each column only when the condition is satisfied. After that, it ought to exit the loop and move to the first one. I argue that this loop should iterate over a new line each time (the line below). Unfortunately, I am unable to make this work. It moves on to the second loop, fills every cell in a subsequent sheet, and then ends. There is no more row in the program.
ee my code, please let me know what I do wrong.
currentCol = 4
currentRow = 11
Do While originalSheet.Cells(currentRow, 1).Value <> ""
Do While currentHeader <> "Finish"
currentHeader = originalSheet.Cells(8, currentCol).Value
divider1 = originalSheet.Cells(currentRow, currentCol).Value
divider2 = originalSheet.Cells(17, currentCol).Value
If divider1 <> 0 Then
divisionResult = divider1 / divider2
Else
divisionResult = 0
End If
newSheet.Cells(currentRow, currentCol).Value = divisionResult
currentCol = currentCol + 2
Loop
currentRow = currentRow + 1
Loop