Lets say i = 9 and I want to delete the 9. row in a worksheet, sheet1, by only using i to refer to the row.
I use the following code:
i = 9
Debug.Print ("""" & i & ":" & i & """")
Worksheets("sheet1").Rows("""" & i & ":" & i & """").Delete Shift:=xlUp
My first line debug prints: "9:9"
So one should think I refer to row 9 correctly. Writing: Worksheets("sheet1").Rows("9:9").Delete Shift:=xlUp
also works
Bookmarks