ChristmasCarol
New Member
- Joined
- Apr 17, 2018
- Messages
- 7
Hello,
I'm stuck at a Piece of Code where I try to delete all rows from row 2 to row (variable).
My Code Looks like that:
I looked it up and it seems to me that the Syntax is correct but I always get an error 1004 at the last Code line.
What do I miss?
I'm stuck at a Piece of Code where I try to delete all rows from row 2 to row (variable).
My Code Looks like that:
Code:
dim lng_rdel as Long
dim wb_paste as workbook
lng_rdel = wb_paste.Worksheets("csv").UsedRange.SpecialCells(xlCellTypeLastCell).Row
wb_paste.Worksheets("csv").Range(Rows(2), Rows(lng_rdel)).EntireRow.Delete
I looked it up and it seems to me that the Syntax is correct but I always get an error 1004 at the last Code line.
What do I miss?
