Sub macro()
Dim i As Integer
Dim row As Long
row = Cells(Rows.Count, 1).End(xlUp).row
For i = 1 To row Step 1 'count rows in column "A"
If Cells(i, "G").Value = 0 Then
Rows(i).EntireRow.Hidden = True
End If
If Cells(i, "F").Value = 0 Then
Rows(i).EntireRow.Hidden = True
End If
Next
End Sub
is there a macro I can run that would hide any rows 2-200 if the amounts in columns F or G are zero?
Sub macro()
Dim i As Integer
Dim row As Long
row = Cells(Rows.Count, 1).End(xlUp).row
For i = 1 To row Step 1 'count rows in column "A"
If Cells(i, "G").Value = 0 and Cells(i, "F").Value = 0 Then
Rows(i).EntireRow.Hidden = True
End If
Next
End Sub
thanks, but a majority of the rows will have a value in columns F or G. I just want the rows that have zeros in both columns to hide
sorry that's my bad. I do really appreciate your help. I didn't realize I worded it incorrectly until I used your code and figured out what was going on