View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default find & replace (hidden) '

JulieD,

Using "Trim" on each cell in the range will remove '.
However, Trim wipes out formulas and balks at cell errors.
So set up a range using "Special Cells" to select constants and text values or
check each cell as you come to it...
'-----------------------------------
Sub GetThemCritters()
Dim objCell As Range
For Each objCell In ActiveSheet.UsedRange 'or Selection
If Not IsError(objCell) And Not objCell.HasFormula Then _
objCell.Value = Trim$(objCell.Value)
Next 'objCell
End Sub
'-------------------------------------

Regards,
Jim Cone
San Francisco, CA
'----------------------------------------
"JulieD" wrote in message ...
hi
how can i write code to search a worksheet & replace all hidden ' with
nothing when the cell is (otherwise) empty
Cheers
JulieD