Carlos Ruano
Member
Hi,
I would like to be able to delete all rows of data which have 0.00 in the fifth column. The column header is "Hrs per Position", and the sheet name is "GPT to PlanView Mapping". The number of rows will change from time to time.
I found the following code, but it is not working for me, and I do not know how to fix it.
Option 1:
Sub Format()
Dim Fund As Long
Dim TotalLoop As Long
RowCount = Range("A65536").End(xlUp).Row
For TotalLoop = RowCount To 2 Step -1
Fund = Cells(TotalLoop, 10)
If Fund = 0 Then
Rows(TotalLoop).Delete
Cells(TotalLoop - 1, 10) = Fund
End If
Next TotalLoop
End Sub
Option 2:
Sub Format()
Dim sh As Worksheet
Dim Fund As Long
Dim TotalLoop As Long
Set sh = ThisWorkbook.Sheets("Sheet1")
RowCount = sh.Range("A1", sh.Range("A1").End(xlDown)).Rows.Count
For TotalLoop = RowCount To 2 Step -1
Fund = Cells(TotalLoop, 10)
If Fund = 0 Then
Rows(TotalLoop).Delete
End If
Next TotalLoop
End Sub
Any help would be greatly appreciated!!
Carlos
I would like to be able to delete all rows of data which have 0.00 in the fifth column. The column header is "Hrs per Position", and the sheet name is "GPT to PlanView Mapping". The number of rows will change from time to time.
I found the following code, but it is not working for me, and I do not know how to fix it.
Option 1:
Sub Format()
Dim Fund As Long
Dim TotalLoop As Long
RowCount = Range("A65536").End(xlUp).Row
For TotalLoop = RowCount To 2 Step -1
Fund = Cells(TotalLoop, 10)
If Fund = 0 Then
Rows(TotalLoop).Delete
Cells(TotalLoop - 1, 10) = Fund
End If
Next TotalLoop
End Sub
Option 2:
Sub Format()
Dim sh As Worksheet
Dim Fund As Long
Dim TotalLoop As Long
Set sh = ThisWorkbook.Sheets("Sheet1")
RowCount = sh.Range("A1", sh.Range("A1").End(xlDown)).Rows.Count
For TotalLoop = RowCount To 2 Step -1
Fund = Cells(TotalLoop, 10)
If Fund = 0 Then
Rows(TotalLoop).Delete
End If
Next TotalLoop
End Sub
Any help would be greatly appreciated!!
Carlos