View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Henrich Henrich is offline
external usenet poster
 
Posts: 53
Default Clear contents with condition

Hi, i'm using this (there are other options to do this):

Sub Clear()
Row = 1
Do Until Cells(Row, 8) = ""
Text = Cells(Row, 8)
If Text = """(""" Then Cells(Row, 8).ClearContents
Row = Row + 1
Loop
End Sub

This code is searching for your string until it reach first empty cell in
column H.

Henrich

€žVanna" napÃ*sal (napÃ*sala):

Hi everyone,

I'm a novice user in Excel Macros... still a lot more to be learn.
I need to write a code to clear cell contents under from column H if the
cell contains "("

I used:

Range = €œH:H€
For each cell in range
If substring of cell.value=")" then
cells.ClearContents
next

In advance, thank you for your help.