Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Not empty but zero


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

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Not empty but zero

Try:


Sub RealZero()
Dim iLastRow As Long
Dim i As Long
Dim rng As Range

iLastRow = 65536
For i = 1 To iLastRow
If Cells(i, 17).Value = 0 And Not IsEmpty(Cells(i, 17)) Then
If rng Is Nothing Then
Set rng = Rows(i)
Else
Set rng = Union(rng, Rows(i))
End If
End If
Next i

If Not rng Is Nothing Then
rng.Delete

End If



End Sub

--
Gary's Student


"Metrazal" wrote:


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

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


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
in excel..:can't empty clip are" but already empty Alan Gauthier Excel Discussion (Misc queries) 0 February 10th 06 08:02 PM
Finding next empty empty cell in a range of columns UncleBun Excel Programming 1 January 13th 06 11:22 PM
Excel - Autom. Filter "Empty / Non Empty cells" should come first Rom Excel Discussion (Misc queries) 0 August 10th 05 04:32 PM
How can I convert empty strings to empty cells? Shane Excel Discussion (Misc queries) 2 July 19th 05 12:10 PM
Can blank cells created using empty Double-Quotes not be empty?? JohnI in Brisbane Excel Programming 6 September 7th 03 11:22 PM


All times are GMT +1. The time now is 12:20 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"