View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Delete Specific Contents

This would probably be considered "cleaner" and also more "proper" as it
specifies the worksheet to apply the code to (so, change my example
worksheet name of "Sheet1" to whatever your actual worksheet name is)...

Sub RemoveUserAndTheodoreGalin()
Dim C As Range, R As Range, V As Variant
On Error Resume Next
Set R = Worksheets("Sheet1").Range("A:A")
For Each V In Array("User", "Theodore Galin")
Set C = R.Find(What:=V, LookAt:=xlWhole)
Do While Not C Is Nothing
C.Clear
Set C = R.FindNext(C)
Loop
Next
End Sub

Note that you can expand the functionality of this code by simply adding
more text strings to the Array function call if necessary.

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
I would think this macro will work and be quite quick as well...

Sub RemoveUserAndTheodoreGalin()
Dim C As Range
On Error Resume Next
Set C = Range("A:A").Find(What:="User", LookAt:=xlWhole)
Do While Not C Is Nothing
C.Clear
Set C = Range("A:A").FindNext(C)
Loop
Set C = Range("A:A").Find(What:="Theodore Galin", LookAt:=xlWhole)
Do While Not C Is Nothing
C.Clear
Set C = Range("A:A").FindNext(C)
Loop
End Sub

--
Rick (MVP - Excel)


"TGalin" wrote in message
...
I would like to create a macro that will search Column A and every time it
finds a cell that says "User" or "Theodore Galin" the contents of that
cell
will be deleted. Can you help me with this?