delete cell

  • Thread starter Thread starter vikram
  • Start date Start date
V

vikram

Hi

I need a macro which upon finding "=-" in a cell in column clears tha
cell, not delete , clears that cell.
thank
 
vikram,

For Column A:

Sub MacroForVikram()
Dim myCell As Range

Set myCell = Range("A:A").Find(What:="=-", _
LookIn:=xlFormulas, _
LookAt:=xlPart)
While Not myCell Is Nothing
myCell.ClearContents
Set myCell = Range("A:A").FindNext
Wend
End Sub

HTH,
Bernie
MS 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

Back
Top