View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default clearing the contents of specified cells

Hi Jimmy,

Here is a simple macro that gives you must of what you want.

Sub Findit()
Dim cell As Range
Dim myKeyword

myKeyword = "Bob"
Set cell = Cells.Find(myKeyword)
If Not cell Is Nothing Then
Range("A1:G" & cell.Row - 1).ClearContents
End If
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jimmy Pop" wrote in message
oups.com...
i am trying to write a macro the clears the cells from a fixed starting
point to a keyword whose location could change everyday.
i want to clear a range of cells (say a1:g1) and all the rows from the
fixed starting point to the row above the keyword. For some reason i
can't figure what to do. Any help would be appreciated.

Thanks!