Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've tried this two different ways, neither seems to work quite right.
Set sentWS = ThisWorkbook.Worksheets("Sent") lastRow = sht.UsedRange.Rows.count 'last row of current sheet currentRow = sentWS.UsedRange.Rows.count 'last row of sent sheet currentRow = currentRow + 1 While lastRow 1 Set cell = sht.Range("A" & lastRow) cell.EntireRow.Copy sentWS.Range("A" & currentRow) (1) cell.Rows(lastRow).Delete (2) cell.EntireRow.Delete currentRow = currentRow + 1 lastRow = lastRow - 1 Wend The line labeled (1) above fails to do anything at all, and the line labeled (2) deletes the first line instead of the last line. The copy works just fine, as does the rest of the code. So what am I doing wrong please? Thank you |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro for deleting rows and serialising the remaing rows | Links and Linking in Excel | |||
Macro for deleting rows and serialising the remaing rows | Setting up and Configuration of Excel | |||
Macro for deleting rows and serialising the remaing rows | Excel Worksheet Functions | |||
Help!!! I have problem deleting 2500 rows of filtered rows | Excel Programming | |||
deleting hidden rows so i can print only the rows showing?????? | Excel Worksheet Functions |