Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Clear contents if x is not in the row

I need to clear the contents in all rows except rows with
the word "ALL" in it.

Can someone help?
Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Clear contents if x is not in the row

Sub Tester9()
Dim rng As Range
Dim fAddr As String
Columns(1).Insert
Set rng = Cells.Find("All", AFter:=Range("IV65535"), _
LookIn:=xlValues, LookAt:=xlPart)
If Not rng Is Nothing Then
fAddr = rng.Address
Do
Cells(rng.Row, 1).Value = "X"
Set rng = Cells.FindNext(rng)
Loop While rng.Address < fAddr
Else
ActiveSheet.UsedRange.Rows.Delete
Columns(1).Delete
Exit Sub
End If
Set rng = Columns(1).SpecialCells(xlBlanks)
rng.EntireRow.Delete
Columns(1).Delete
End Sub

--
Regards,
Tom Ogilvy

"Mighvik" wrote in message
...
I need to clear the contents in all rows except rows with
the word "ALL" in it.

Can someone help?
Thanks




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
Clear Contents gibbylinks Setting up and Configuration of Excel 5 October 12th 09 05:04 PM
Clear Contents Secret Squirrel Excel Discussion (Misc queries) 1 February 3rd 09 12:37 AM
Clear Contents Macro SJC Excel Worksheet Functions 3 October 27th 05 07:26 PM
Clear Contents But Not Formula Gancom3 Excel Discussion (Misc queries) 2 February 1st 05 11:30 PM
xlClipboard Clear Contents John Wilson Excel Programming 6 August 16th 03 12:03 AM


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

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"