Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |