To determine whether a cell is a number or not before deleting it, I'm using this code, however I have three columns to check. However, Do Until merely executes the loop once before ceasing all execution and changing the col to 5 or 8 as it is in the for loop.
Could you please explain to me what I'm doing incorrectly in this code?
Another issue I've run into is that when a cell is empty, VBA automatically fills it with the number 0. Is there a method to prevent this from happening?
Sub copy()
Dim Row As Long
Dim Col As Long
Row = 1
For Col = 2 To 8 Step 3
Do Until Cells(Row, 1).Value = ""
If IsNumeric(Cells(Row, Col)) = False Then
Cells(Row, Col).Clear
Else
Cells(Row, Col).Select
If Cells(Row, Col).Value = 0 Then
Cells(Row, Col).Value = (Cells(Row, Col).Value) * 1
Cells(Row, Col).NumberFormat = "$ #,##0.00"
Else
Cells(Row, Col).Value = CDec((Cells(Row, Col).Value))
Cells(Row, Col).NumberFormat = "$ #,##0.00"
End If
End If
Row = Row + 1
Loop
Next
End Sub