Excel: cant figure out compile error: do without loop


Hi guys, I can't figure out where is the do - loop error im having... my code is as follows


Sub round()
Application.ScreenUpdating = False
        Application.DisplayStatusBar = False
Dim i As Integer
Dim j As Integer
Dim a As Integer
Dim b As Integer
a = 2
b = -2
i = 10 'start row
j = -2 'start column
'heading
Do Until Cells(a, b).value = ""
If Cells(a, b).value = "Ag (Silver)" Then 'header start
      
      i = 10
      j = j + 4
      b = b + 4
Do
If IsNumeric(Cells(i, j).value) = True Then '1 dec place
Call Dec_places(Cells(i, j).value, 1)
Else
i = i + 1
End If
Loop Until Cells(i, j + 1).value = ""
     
     
Else
Do
If IsNumeric(Cells(i, j).value) = True Then '0 dec place
Call Dec_places(Cells(i, j).value, 0)
Else
i = i + 1
End If
Loop Until Cells(i, j + 1).value = ""
End If
Application.ScreenUpdating = True
        Application.DisplayStatusBar = True
End Sub
Thanks in advance


This question generated 10 answers. To proceed to the answers, click here.

This thread is current as of June 05, 2018.


For more resources for Microsoft Excel