IF statements in Macros

F

Farley Granger

In a Macro I want to put a blank in a cell if that cell contains the word
"All"
Can someone tell me how to do that?
Thanks
 
V

Vasant Nanavati

Sub AllOrNothing()
If Range("A1") = "All" Then Range("A1") = ""
End Sub
 
G

Gord Dibben

Farley

Sub All_Gone()
For Each cel In Selection
If cel.Value = "All" Then
cel.Value = ""
'or cel.ClearContents
End If
Next
End Sub

Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top