+ Reply to Thread
Results 1 to 2 of 2

Thread: Running macros on multiple windows

  1. #1
    Registered User
    Join Date
    01-26-2012
    Location
    Brighton, UK
    MS-Off Ver
    Excel 2007
    Posts
    4

    Running macros on multiple windows

    I'm running a macro that has worked on previous computers (windows xp and office 2000), I'm now using windows 7 and office 2007.

    The macro is designed to cycle through a number of windows, the amount defined using an inputbox function, taking data from each file and putting it into a summary file. Currently, the macro is only working for the first window and wont cycle through. The program reads as follows:


    Sheetall = InputBox("Number of worksheets to be analysed?")
          Sheettot= Val(Sheetall)
    
          For sheetnow= 1 To Sheettot
                  Windows(sheetnow+ 1).Activate
    
                      (here is the main body of the macro, which is working fine)
    
          Next sheetnow

    Can anyone please help??
    Last edited by noxid82; 01-26-2012 at 10:39 AM.

  2. #2
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,640

    Re: Running macros on multiple windows

    Your post does not comply with Rule 3 of our Forum RULES. 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 # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

+ 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.2.0