I am getting an error message: "Delete method of range class filed" with my code below.
I have bolded the section that is highlighted when I try to debug this. I've picked up this code from another post, and it worked earlier, but now it does not. The only thing I've done was copy this macro to my personal.xls file. Thank you, in advance, for any assistance.
' This section will delete any rows where the amount field is blank.
Dim Rng As Range, Rng2 As Range
Set Rng = Range("j500").End(xlUp)
Do Until Rng.Row = 12
Set Rng2 = Rng.Offset(-1, 0)
If Rng = "" Then Rng.EntireRow.Delete
Set Rng = Rng2
Loop
I have bolded the section that is highlighted when I try to debug this. I've picked up this code from another post, and it worked earlier, but now it does not. The only thing I've done was copy this macro to my personal.xls file. Thank you, in advance, for any assistance.
' This section will delete any rows where the amount field is blank.
Dim Rng As Range, Rng2 As Range
Set Rng = Range("j500").End(xlUp)
Do Until Rng.Row = 12
Set Rng2 = Rng.Offset(-1, 0)
If Rng = "" Then Rng.EntireRow.Delete
Set Rng = Rng2
Loop