Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a sheet that once cell "A" is blank, I want that row and all the rows forward to be deleted. How can this be done? Thanks, Me -- Metraza ----------------------------------------------------------------------- Metrazal's Profile: http://www.excelforum.com/member.php...fo&userid=3164 View this thread: http://www.excelforum.com/showthread.php?threadid=51618 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How does cell A become blank? What does cell "A" mean?
-- Regards, Tom Ogilvy "Metrazal" wrote in message ... I have a sheet that once cell "A" is blank, I want that row and all the rows forward to be deleted. How can this be done? Thanks, Met -- Metrazal ------------------------------------------------------------------------ Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648 View this thread: http://www.excelforum.com/showthread...hreadid=516182 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() What I am looking for is a way to delete all the rows forward once the first row in column A is empty. Sorry for my Misuse of the English. Thanks, Met -- Metrazal ------------------------------------------------------------------------ Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648 View this thread: http://www.excelforum.com/showthread...hreadid=516182 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
right click on the sheet tab and select view code. paste in code like this
Private Sub Worksheet_Change(ByVal Target As Excel.Range) On error goto errhandler if len(trim(Range("A1").Value) = 0 then Application.EnableEvents = False rows.delete end if ErrHandler: Application.EnableEvents = True End Sub If you are not familiar with events, see Chip Pearson's page on events http://www.cpearson.com/excel/events.htme -- Regards, Tom Ogilvy "Metrazal" wrote in message ... What I am looking for is a way to delete all the rows forward once the first row in column A is empty. Sorry for my Misuse of the English. Thanks, Met -- Metrazal ------------------------------------------------------------------------ Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648 View this thread: http://www.excelforum.com/showthread...hreadid=516182 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I get a compile error with this code on the if statement. What is len? Length? I don't know.. Anyway, I could not get this code to work. Any help? Thanks, Met -- Metrazal ------------------------------------------------------------------------ Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648 View this thread: http://www.excelforum.com/showthread...hreadid=516182 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It was a last minute change to be a bit more robust since I don't have any
knowledge of your sheet. I left off a closing parenthesis. Len checks the length of the entry in the cell. this should work even if it looks blank. Private Sub Worksheet_Change(ByVal Target As Excel.Range) On error goto errhandler if len(trim(Range("A1").Value)) = 0 then Application.EnableEvents = False rows.delete end if ErrHandler: Application.EnableEvents = True End Sub -- Regards, Tom Ogilvy "Metrazal" wrote in message ... I get a compile error with this code on the if statement. What is len? Length? I don't know.. Anyway, I could not get this code to work. Any help? Thanks, Met -- Metrazal ------------------------------------------------------------------------ Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648 View this thread: http://www.excelforum.com/showthread...hreadid=516182 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hpw do I delete multiple empty rows found between filled rows? | Excel Worksheet Functions | |||
Delete Empty Rows | Excel Discussion (Misc queries) | |||
How to Delete empty rows in excel in b/w rows with values | Excel Worksheet Functions | |||
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows | Excel Worksheet Functions | |||
Delete empty rows with cell type 2 | Excel Discussion (Misc queries) |