+ Reply to Thread
Results 1 to 4 of 4

Help with applying this macro to the whole workbook

Hybrid View

Sagaroth Help with applying this macro... 12-09-2013, 06:37 AM
XOR LX Re: Help with applying this... 12-09-2013, 06:58 AM
Sagaroth Re: Help with applying this... 12-09-2013, 07:03 AM
XOR LX Re: Help with applying this... 12-09-2013, 07:07 AM
  1. #1
    Registered User
    Join Date
    12-09-2013
    Location
    BS
    MS-Off Ver
    Excel 2007
    Posts
    2

    Help with applying this macro to the whole workbook

    Hi there excel experts

    Please help me with changing of one macro.



    Sub clear_zero()
          Dim rng1 As Range
    Set rng1 = Columns(2)
    With rng1
        .AutoFilter 1, "0"
        With rng1.Offset
            .ClearContents
            .ClearComments
        End With
    End With
    
    End Sub

    This macro is clearing zero values of column number 2.
    It is working only on active worksheet. It should work on every worksheet in the wrokbook.

    Thanks for the help!

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Help with applying this macro to the whole workbook

    Hi,

    Perhaps:


    Sub clear_zero()
          
    Dim i As Integer
    
    For i = 1 To ActiveWorkbook.Worksheets.Count
    
    With Sheets(i).Columns(2)
    
        .AutoFilter 1, "0"
        .ClearContents
        .ClearComments
    
    End With
    
    Next
    
    End Sub
    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    12-09-2013
    Location
    BS
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Help with applying this macro to the whole workbook

    Thank you XOR LX. Smooth and perfect

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Help with applying this macro to the whole workbook

    You're welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro Applying Print Fit to One Page on All Worksheets in Workbook
    By brokbird in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-24-2013, 09:13 PM
  2. [SOLVED] Applying a macro to all worksheets in workbook
    By samz93 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-07-2013, 02:47 AM
  3. Applying macro found online to another workbook
    By sellim in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-20-2012, 11:22 AM
  4. Applying a Workbook's Names to Another Workbook
    By orangepips in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-29-2005, 10:10 AM
  5. [SOLVED] Applying same macro to all worksheets in workbook
    By jsadd1@gmail.com in forum Excel General
    Replies: 2
    Last Post: 10-19-2005, 07:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1