+ Reply to Thread
Results 1 to 3 of 3

Running code for many sheets

  1. #1
    Registered User
    Join Date
    07-03-2012
    Location
    Almaty
    MS-Off Ver
    Excel 2007
    Posts
    3

    Running code for many sheets

    Hi.
    I have some VBA code which inserts empty columns for missed numbers of each column.
    Example in attachment.
    Everything works OK, but only for one worksheet.
    If I manually select by "Shift" several worksheets and when I run my code, it works only for first worksheet in worksheets range that I select.
    So how can I modify this code for several worksheets?
    Thanx in advance.
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Running code for many sheets

    Hi plus_stick and welcome to the forum,

    You will need to move your code to a MODULE if you want it to work on different sheets. See the attached where I think the problem is solved.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    07-03-2012
    Location
    Almaty
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Running code for many sheets

    MarvinP

    Thanx for your help.
    It's what I need.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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