PDA

View Full Version : Solved: Deleting 0 (zero) from cells



drums4monty
12-02-2008, 07:02 AM
Hi

Is there an easy way to delete the figure 0 from cells? The cells will be found in Columns B, D, F & H. and go from row 6 - 66.

mikerickson
12-02-2008, 07:20 AM
Find and replace worked for me
Find: 0
ReplaceWith:

lucas
12-02-2008, 08:05 AM
You might apply Johnske's kb entry to the range:

http://vbaexpress.com/kb/getarticle.php?kb_id=440


Option Explicit

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
ActiveWindow.DisplayZeros = False
End Sub

drums4monty
12-02-2008, 08:20 AM
Many thanks Mikeriskdon thats exactly what I wanted, now why did'nt I think of that. Its also good to see the code that would have worked also though lucas, many thanks.

Krishna Kumar
12-02-2008, 08:24 AM
Hi,

With Range("B:B,D:D,F:F,H:H")
On Error Resume Next
.SpecialCells(xlCellTypeConstants).Replace What:="0", Replacement:="", LookAt:=xlWhole
.SpecialCells(xlCellTypeFormulas).Replace What:="0", Replacement:="", LookAt:=xlWhole
On Error GoTo 0
End With

HTH