LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default How do I do this.

psuedo code:

Sub standard()
Dim myVar As String
myVar = "Something to find"
Set myRange = Sheets(1).Range("A2:A100")
For Each c In myRange
If c.Value = myVar Then
'Do something
End If
Next
End Sub

Looks for the phrase "Something to find" in each cell of Range A2:A100 and
if found it does whatever you put in place of 'Do Something. Could be:

c.EntireRow.Delete
c.ClearContents
c.EntireColumn.Hidden = True


"yarrido" wrote:

I am just starting out in working with the VBA in excel and was
wondering if anyone had some idea how I would go about doing this. I
want to be able to search a column for a specific match(I can do
this), then I want to select the row that the match is found in and
either clear it or delete it altogether. Please keep in mind that the
information for the row,column will have to be in variables before a
command is constructed to do the clearing or deletion. If anyone has
any idea on how to do this quickly, elegantly and efficiently, I would
appreciate some ideas on it. 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



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