+ Reply to Thread
Results 1 to 2 of 2

run a macro through many sheets in one workbook (sheets have names individually)

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-06-2014
    Location
    iran
    MS-Off Ver
    2016
    Posts
    110

    run a macro through many sheets in one workbook (sheets have names individually)

    hi
    i want to run this code through the sheets but i faced with error
    Sub b()
    Worksheets(Array(1 - 10 - 2017), (1 - 11 - 2017), (1 - 12 - 2017), (6 - 1 - 2017), (8 - 1 - 2017), (5 - 1 - 2017),(7 - 1 - 2017),(4-1-2017),(3-1-2017),(9-1-2017),(2-1-2017),(1-1-2017)).Select
    
        Worksheets(10- 1 - 2017).Activate
        Rows("1:1").Select
        Selection.delete Shift:=xlUpm.PNG
        Range("A1:B1550").Select
        Range("A3").Activate
        Selection.AutoFilter
        ActiveSheet.Range("$A$1:$B$1550").AutoFilter Field:=2, Operator:= _
            xlFilterValues, Criteria2:=Array(0, "10/31/2017")
        Range("A1:A1501").Select
        Selection.ClearContents
        Range("B1:B1501").Select
        Selection.NumberFormat = "[$-409]d-mmm-yyyy;@"
        Range("D1101").Select
        Selection.AutoFilter
        ActiveWorkbook.Save
      
    'Normaly here you save the work
    End Sub

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,973

    Re: run a macro through many sheets in one workbook (sheets have names individually)

    What is the error and which line of code is highlighted when you click on debug when you get the error?
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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. Numbering sheets individually
    By Xander Crews in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 03-24-2016, 04:43 PM
  2. [SOLVED] controlling sheet names when adding sheets to a workbook in a macro
    By jmac1947 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2014, 03:30 AM
  3. How to create individual sheets from one sheet and email them individually
    By Shoju in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-21-2013, 11:18 AM
  4. [SOLVED] Highlighting the same cell in one workbook with multiple sheets with various sheets names.
    By DanielRay in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2013, 01:50 PM
  5. Replies: 0
    Last Post: 10-10-2012, 08:56 AM
  6. Replies: 3
    Last Post: 04-22-2010, 10:24 AM
  7. [SOLVED] Macro for filter on protected workbook that works for all sheets, no matter what sheets are named?
    By StargateFanFromWork in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-26-2006, 02:35 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