MatthewLane412
New Member
- Joined
- Aug 23, 2017
- Messages
- 24
Hello,
I am still quiet new to VBA. I am working with a spreadsheet that requires me to Divide one column by another (eg. G2/F2, G3/F3, G4/F4...).
I'm having trouble getting "Then GoTo" skip to work in my code. If a cell in column "G" or column "F" has the variable "$0.00", i would like to skip to the next row.
I appreciate any and all help.
Thanks,
Matt
I am still quiet new to VBA. I am working with a spreadsheet that requires me to Divide one column by another (eg. G2/F2, G3/F3, G4/F4...).
I'm having trouble getting "Then GoTo" skip to work in my code. If a cell in column "G" or column "F" has the variable "$0.00", i would like to skip to the next row.
Code:
Sub Division()
Dim finRow As String
finRow = Sheet2.Range("A6500").End(xlUp).Row
Dim I As Long
I = 2
Do Until I = finRow
If Sheet2.Range("G" & I).Value = "$0.00" Then GoTo Skip
Sheet2.Range("H" & I).Formula = "=G" & I & "/F" & I
Sheet2.Range("J" & I).Formula = "=I" & I & "/F" & I
Skip:
I = I + 1
Loop
End Sub
I appreciate any and all help.
Thanks,
Matt