I have a simple macro I need some help with.
I want to spin through a row range of cells (O2,X2) on a specific page. As I spin through, I want to check a specific cell in that range (S2) and see if that cell is either NULL or has a zero (0). If either is correct (NULL or 0) then delete the range and move the cells below up.
I am not familiar with the VB/Excel syntax but here is what I was starting with and obviously does not work.
Any help would be greatly appreciated.
Dim f_RowCount
f_RowCount = 275
For i = 2 To f_RowCount
f_cell1 = "0" & i
f_cell2 = "X" & i
f_checkcell = "S" & i
If IsNull(f_checkcell) Or (f_checkcell = 0) Then
Sheets("Sheet2").Select
Range(f_cell1, f_cell2).Select
Selection.Delete Shift:=x1Up
End If
Next i
I want to spin through a row range of cells (O2,X2) on a specific page. As I spin through, I want to check a specific cell in that range (S2) and see if that cell is either NULL or has a zero (0). If either is correct (NULL or 0) then delete the range and move the cells below up.
I am not familiar with the VB/Excel syntax but here is what I was starting with and obviously does not work.
Any help would be greatly appreciated.
Dim f_RowCount
f_RowCount = 275
For i = 2 To f_RowCount
f_cell1 = "0" & i
f_cell2 = "X" & i
f_checkcell = "S" & i
If IsNull(f_checkcell) Or (f_checkcell = 0) Then
Sheets("Sheet2").Select
Range(f_cell1, f_cell2).Select
Selection.Delete Shift:=x1Up
End If
Next i