Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I want to be able to - on the click of a button - find the last row in a list and delete the complete line. How do I do this? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try
rows(cells(rows.count,"a").end(xlup).row).delete -- Don Guillett SalesAid Software "Newbie" wrote in message ... Hi, I want to be able to - on the click of a button - find the last row in a list and delete the complete line. How do I do this? Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
if your list is in column A (that is column A indicates the last row). Try the following macro Sub delete_last_row() Dim rng As Range Set rng = Cells(Rows.Count, 1).End(xlUp) 'change the 1 according to your column with data rng.EntireRow.Delete End Sub Assign this macro to a button/toolbar Frank Newbie wrote: Hi, I want to be able to - on the click of a button - find the last row in a list and delete the complete line. How do I do this? Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
cells(rows.count,1).End(xlup).EntireRow.Delete
is one possibility. -- Regards, Tom Ogilvy "Newbie" wrote in message ... Hi, I want to be able to - on the click of a button - find the last row in a list and delete the complete line. How do I do this? Thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks works a treat
Is it possible for you to explain the syntax or tell me where I can find out about it Thanks again "Don Guillett" wrote in message ... try rows(cells(rows.count,"a").end(xlup).row).delete -- Don Guillett SalesAid Software "Newbie" wrote in message ... Hi, I want to be able to - on the click of a button - find the last row in a list and delete the complete line. How do I do this? Thanks |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
there is no reason to retrieve the row number and feed it to the rows
object. Just use what you find directly cells(rows.count,1).End(xlup).EntireRow.Delete go to the bottom of the spreadsheet. Select cell A65536. Hit the end button, then the up arrow, then do Edit= delete and select Entire Row That is pretty much it. -- Regards, Tom Ogilvy "Newbie" wrote in message ... Thanks works a treat Is it possible for you to explain the syntax or tell me where I can find out about it Thanks again "Don Guillett" wrote in message ... try rows(cells(rows.count,"a").end(xlup).row).delete -- Don Guillett SalesAid Software "Newbie" wrote in message ... Hi, I want to be able to - on the click of a button - find the last row in a list and delete the complete line. How do I do this? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
delete the test values, but do not delete the formulas | Excel Discussion (Misc queries) | |||
How can I delete a macro when the Delete button is not active? | Excel Worksheet Functions | |||
How to Delete a Range in Closed Workbook (to Replace Delete Query) | Excel Discussion (Misc queries) | |||
How do i delete a macro in Excel 2003 when delete isn't highlight | Excel Discussion (Misc queries) | |||
How to delete rows when List toolbar's "delete" isnt highlighted? | Excel Worksheet Functions |