VBA forms - HELP!!!

O

One-Leg

Hello,

I'm using the following in a macro but it doesn't work:

Range("A2:A65536").Select
If Cells.Select = "0" Then Selection.ClearContents

What should I change???
 
D

Don Guillett

I just recorded the macro6 below but it could be simply

Columns(1).Replace "0", ""

Sub Macro6()
'
' Macro6 Macro
' Macro recorded 12/15/2004 by Don Guillett
'

'
Columns("A:A").Select
Selection.Replace What:="0", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub
 
O

One-Leg

Hello,

I have many cells with numbers in them and many come up with only a "0" in
them. I want to use a macro that will see the value of the cell and if it is
"0", then I would like to clear the cell. If it's anything else than "0",
nothing should be done!!!

Thanks
 
O

One-Leg

Hello,

I did that allready but the other cells in colum A that have numbers
(105482102542) in them, the "0" are removed and that is not a good thing...
:-(

Thanks!!!
 
D

Don Guillett

then use
Columns(1).Replace "0", "", LookAt:=xlWhole
or, more simply
Columns(1).Replace "0", "", xlWhole
 
Top