Consulting

Results 1 to 5 of 5

Thread: Solved: Deleting 0 (zero) from cells

  1. #1

    Solved: Deleting 0 (zero) from cells

    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.

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    Find and replace worked for me
    Find: 0
    ReplaceWith:

  3. #3
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    You might apply Johnske's kb entry to the range:

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

    [VBA]
    Option Explicit

    Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    ActiveWindow.DisplayZeros = False
    End Sub
    [/VBA]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  4. #4
    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.

  5. #5
    VBAX Contributor
    Joined
    Jul 2004
    Location
    Gurgaon, India
    Posts
    148
    Location
    Hi,

    [vba]With Range("B:B,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[/vba]

    HTH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •