Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete record if cell is empty


I need the code to delete a record/row if cell Q (of that record/row) i
empty.

What would be the best way to achieve this?

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=51490

  #2   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 67
Default Delete record if cell is empty

sub deleterow
dim cou as double
for cou = activesheet.usedrange.rows.count to 1 step-1
if activesheet.range("Q"&cou) = "" then _
activesheet.rows(cstr(cou)).delete
next
end sub
--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"Metrazal" wrote:


I need the code to delete a record/row if cell Q (of that record/row) is
empty.

What would be the best way to achieve this?

Thanks,

Met


--
Metrazal
------------------------------------------------------------------------
Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648
View this thread: http://www.excelforum.com/showthread...hreadid=514900


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Delete record if cell is empty

Try something like

Range("Q:Q").SpecialCells(xlCellTypeBlanks).Entire Row.Delete


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Metrazal"
wrote in
message
...

I need the code to delete a record/row if cell Q (of that
record/row) is
empty.

What would be the best way to achieve this?

Thanks,

Met


--
Metrazal
------------------------------------------------------------------------
Metrazal's Profile:
http://www.excelforum.com/member.php...o&userid=31648
View this thread:
http://www.excelforum.com/showthread...hreadid=514900



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete record if cell is empty


Same senerio except the cell is a zero value. Not empty
but 0.


Thanks in advance...

Met


--
Metrazal
------------------------------------------------------------------------
Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648
View this thread: http://www.excelforum.com/showthread...hreadid=514900

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If cell empty delete row Clive[_2_] Excel Discussion (Misc queries) 1 November 8th 09 12:51 AM
Delete row with empty cell in column Gene Augustin Excel Discussion (Misc queries) 4 March 8th 09 08:03 AM
Delete Empty Cell With Formula [email protected] Excel Discussion (Misc queries) 4 January 26th 08 03:02 PM
Delete empty rows with cell type 2 FrankNL Excel Discussion (Misc queries) 1 May 3rd 06 11:10 AM
Delete record(s) in other cells based on value of one cell. MPope Excel Discussion (Misc queries) 1 October 12th 05 06:57 PM


All times are GMT +1. The time now is 12:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"