Hi, I am trying to insert a condition in a loop. Here is the code:
Sub ezcompare()
'
' ezcompare Macro
'
' Keyboard Shortcut: Ctrl+r
'
Dim i As Integer, j As Integer
Dim Value1 As Integer, Value2 As Integer
Dim z As Integer, y As Integer
Dim q As Integer
Dim Dummy1 As Integer, Dummy2 As Integer
i = 2
j = 2
Do While i < 100
'i is row reference
'j is column reference
Value1 = Cells(5022, j).Value
z = 211 - Value1
Value2 = Cells(5025, j).Value
y = 211 - Value2
'Dummy1 = Cells(z, j).Value
If Cells(z, j).Value >= 0.03 Then
Cells(i, j).Value = 1
End If
If Cells(y, j).Value <= -0.03 Then
Cells(i + 1, j).Value = 1
i = i + 1
j = j + 2
Loop
End Sub
It says DO WHILE without LOOP... Tips and tricks to make it work?
Thanks for the help!
Bookmarks