+ Reply to Thread
Results 1 to 5 of 5

Running Same macro on Multiple sheets

  1. #1
    Registered User
    Join Date
    05-15-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Running Same macro on Multiple sheets

    Hi,

    I am new to VBA and have gone through all the codes for my problem but none of it is working.

    This is the code I want to run on Multiple sheets-
    ----------------------------------------------
    Please Login or Register  to view this content.
    ------------------------------------

    This is the code with which I am trying to make it work on multiple sheets
    ---------------------------------------------
    Please Login or Register  to view this content.
    -----------------------------------

    This gives a compile error "Next without For". Please help.

    Thanks
    ~S
    Last edited by shilpigupta79; 07-01-2013 at 01:22 AM.

  2. #2
    Valued Forum Contributor wenqq3's Avatar
    Join Date
    04-01-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    868

    Re: Running Same macro on Multiple sheets

    Hi shilpigupta79, welcome to Forum.
    Please use forum tool to code tags your code so is readable. Thanks

    Forum Rule#3,
    3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the [#] button at the top of the post window (if you are editing an existing post, press Go Advanced to see the [#] button). The result will appear like this in the post window:
    -If the problem is solved, please mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved".

    -Always upload a workbook before start your question
    To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.

    +++ If my answer(s) helped you, please add me reputation by click on * +++

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Running Same macro on Multiple sheets

    Untested. Personally, I tried to avoid until loop and would prefer to loop using for next. If you are trying to loop through range A, I would change the code like this.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-15-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Running Same macro on Multiple sheets

    Thanks!!
    However, both the codes don't do anything at all.
    The code below works only on one sheet.

    Please Login or Register  to view this content.
    Any help to make this run on multiple worksheets would be greatly appreciated.

    Thanks
    ~S

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Running Same macro on Multiple sheets

    However, both the codes don't do anything at all?
    It is your code and do not know what do you expect them to do. I have only adjusted the code.
    Your latest code loops through all sheets.

+ 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