+ Reply to Thread
Results 1 to 4 of 4

Selectiong MULTIPLE Sheets in 'ThisWorkbook' using "With Sheets" Command

  1. #1
    Forum Contributor
    Join Date
    02-09-2016
    Location
    West Midlands
    MS-Off Ver
    2016
    Posts
    224

    Selectiong MULTIPLE Sheets in 'ThisWorkbook' using "With Sheets" Command

    Hi!

    I have a workbook that has 50 sheets within it.

    They are called (from left to right);

    Bet Angel / Bet Angel (2) / Bet Angel (3)... etc

    I have the following VBA code which Runs a Macro after 5 seconds have passed when the WorkBook is opened;


    Please Login or Register  to view this content.

    Obviously this only Runs the Macro for the sheet "Bet Angel".


    How to i add the rest and get it to run the Macro for all the sheets after 5 seconds of the WorkBook been opened?

    I have tried using an & sign and also comas and a few other attemps. Whats the correct way to add tyhe other sheets to this code?


    Any help greatly appreciated!


    Andy

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Selectiong MULTIPLE Sheets in 'ThisWorkbook' using "With Sheets" Command

    You can just loop through each sheet object.

    Ex:
    Please Login or Register  to view this content.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Selectiong MULTIPLE Sheets in 'ThisWorkbook' using "With Sheets" Command

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Forum Contributor
    Join Date
    02-09-2016
    Location
    West Midlands
    MS-Off Ver
    2016
    Posts
    224

    Re: Selectiong MULTIPLE Sheets in 'ThisWorkbook' using "With Sheets" Command

    Hi!

    So sorry for the late reply guys!

    Yes those both work perfectly, thank you for taking your time. Rep left


    Im learning everyday but sometimes get stuck on the simpler tasks.

+ 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. Replies: 5
    Last Post: 12-01-2017, 01:18 AM
  2. [SOLVED] Add unique value automatically to sheets("to.") and sheets("total")
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-05-2017, 07:53 AM
  3. Replies: 1
    Last Post: 03-09-2016, 12:17 PM
  4. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  5. "The "sheets" method from the "_Global" object have failed."
    By mankit87 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-08-2011, 08:53 AM
  6. [SOLVED] "With Sheets" Issue - macro on one sheet to affect hidden rows on other sheets
    By Punsterr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2006, 12:10 AM
  7. Sheets("sheet1").Range command between workbooks
    By Luc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-27-2005, 09:05 AM

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