Russ At Index
Well-known Member
- Joined
- Sep 23, 2002
- Messages
- 706
- Office Version
- 365
- 2016
- Platform
- Windows
- MacOS
Morning ,
I have the following snippet of code which , whaen run should
remove from my spreadsheet all the zeros ("0") from column G.
Sub myDeleteRows()
'
' ReturnsDescrepancyV1DeleteZeroRows Macro Russ ****ings 18/09/2010
'
'
Dim MyCol As String
Dim MyVal As Variant
Dim i As Integer
MyCol = InputBox("column to look through", "Column Search", "G")
MyVal = InputBox("Value to look for", "search value", 0)
For i = 1 To Range(MyCol & "65536").End(xlUp).Row Step 1
If Application.WorksheetFunction.CountIf(Range("G" & i & ":AZ" & i), MyVal) > 0 Then
Range("G" & i).EntireRow.Delete
End If
Next i
End Sub
Alas it leaves the one row were the answer is correct & removes
7 of the zero rows but leaves 6 showing as 0 !!!
Any help , as ever appreciated,
TIA
Russ
I have the following snippet of code which , whaen run should
remove from my spreadsheet all the zeros ("0") from column G.
Sub myDeleteRows()
'
' ReturnsDescrepancyV1DeleteZeroRows Macro Russ ****ings 18/09/2010
'
'
Dim MyCol As String
Dim MyVal As Variant
Dim i As Integer
MyCol = InputBox("column to look through", "Column Search", "G")
MyVal = InputBox("Value to look for", "search value", 0)
For i = 1 To Range(MyCol & "65536").End(xlUp).Row Step 1
If Application.WorksheetFunction.CountIf(Range("G" & i & ":AZ" & i), MyVal) > 0 Then
Range("G" & i).EntireRow.Delete
End If
Next i
End Sub
Alas it leaves the one row were the answer is correct & removes
7 of the zero rows but leaves 6 showing as 0 !!!
Any help , as ever appreciated,
TIA
Russ