Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Delete cells in row A with just zeroes

Here's one way:
Save a backup copy and test first. Adjust the parameters as needed.

Sub FindNDelete()
Dim rng As Range, cell As Range
Dim strAddress1 As String, rngUnion As Range
Set rng = Range("A:A") 'adjust to suit
Set cell = rng.Find(0, _
LookIn:=xlValues, Lookat:=xlWhole)
If Not cell Is Nothing Then
strAddress1 = cell.Address
Do
If rngUnion Is Nothing Then
Set rngUnion = cell
Else
Set rngUnion = Union(cell, rngUnion)
End If
Set cell = rng.FindNext(cell)
Loop While Not cell Is Nothing And _
cell.Address < strAddress1
End If
If Not rngUnion Is Nothing Then
rngUnion.EntireRow.Delete
End If
End Sub

For more info see www.rubbershoe.com/deleterows.htm.


"Steven R. Berke" wrote in message
om...
I have a column of 4 digit numbers located in Row A that covers about
60 rows. At the bottom of the 4 digit numbers in row A are about 30
rows of zeroes. To the right of the zeroes are blank cells (column
B). To the right the cells of the four digit numbers above the zeroes
is information. Have you any suggestions as to how I can delete the
rows with just zeroes in column A without deleting any of the others
numbers in the rows above zeroes which may contain information.



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
delete cells column. Delete empty cells myshak Excel Worksheet Functions 0 March 9th 09 10:59 PM
Can I set the default for "show zeroes" to not show the zeroes? jeel Setting up and Configuration of Excel 1 January 25th 08 07:18 PM
Format cells in web query (leading zeroes) Kathy Excel Discussion (Misc queries) 5 October 2nd 07 02:26 PM
A fixed field format needs fronting zeroes for each cells value. CommerceMary Excel Worksheet Functions 8 July 25th 07 08:44 PM
How do I format data cells in Excel to keep leading zeroes? LennyD Setting up and Configuration of Excel 2 December 15th 04 10:42 PM


All times are GMT +1. The time now is 04:29 AM.

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

About Us

"It's about Microsoft Excel"