Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: clear cells using VBA

  1. #11
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: clear cells using VBA

    VLookup() is Volatile?

  2. #12
    New Member
    Join Date
    Feb 2012
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: clear cells using VBA

    Quote Originally Posted by NateO View Post
    This should work on formulae results or values:

    Code:
    Sub deltime()
    For Each Cell In [a:a]
    If Cell.Value = "0" Then Cell.ClearContents 'put any value you want here
    Next Cell
    End Sub
    Change [a:a] to the appropriate column. Hope this helps.
    How do you declare the Cell here with option explicit? Dim as what?

  3. #13
    MrExcel MVP VoG's Avatar
    Join Date
    Jun 2002
    Location
    127.0.0.1
    Posts
    63,651
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)

    Default Re: clear cells using VBA

    Dim Cell as Range
    HTH, Peter
    Please test any code on a copy of your workbook.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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