LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Delete Row based on cell contents

or

Sub findsumifslash_A()
With Cells
On Error Resume Next
Set c = .Find("/", After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext)
If Not c Is Nothing Then
firstaddress = c.Address
Do
mystr = mystr & "," & c.Address
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstaddress
End If
End With
Range(Right(mystr, Len(mystr) - 1)).EntireRow.Delete
End Sub

--
Don Guillett
SalesAid Software

"Norman Jones" wrote in message
...
Hi Don,

Columns("A").SpecialCells
(xlCellTypeBlanks).EntireRow.Delete


What if there were legitimate blank cells or the slash character were not
located in any cell?

---
Regards,
Norman



"Don Guillett" wrote in message
...
or this should look at fewer cells than for/next loop

Sub findsumifslash()
With Cells
On Error Resume Next
Set c = .Find("/", After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext)
If Not c Is Nothing Then
firstaddress = c.Address
Do
Rows(c.Row).ClearContents
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstaddress
End If
End With
Columns("A").SpecialCells(xlCellTypeBlanks).Entire Row.Delete
End Sub

--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
How well do you know vba? Look in vba help index for FINDNEXT

--
Don Guillett
SalesAid Software

"Steph" wrote in message
...
Hi. Is it possible to delete the entire row if the contents of cellA
in
that row contains a "/"?

So, I'd like to scan an entire sheet, and delete all rows that have a

"/"
somewhere within the cell contents in column A of each row. Thanks!










 
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
How do I conditionally delete rows based on cell contents? John Chan Excel Worksheet Functions 3 May 17th 23 03:45 AM
Delete ROW based on Cell Contents HeatherJ Excel Discussion (Misc queries) 4 February 11th 10 04:25 PM
Delete cell contents Rob[_4_] Excel Discussion (Misc queries) 7 April 10th 07 12:34 PM
Delete row based on contents of cell AndyG Excel Discussion (Misc queries) 6 November 17th 05 10:08 PM
Delete/clear a cell based on another cells contents jademaddy Excel Programming 2 May 19th 05 06:15 PM


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