+ Reply to Thread
Results 1 to 2 of 2

How to write this loop macro correctly?

  1. #1
    Registered User
    Join Date
    03-11-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    1

    How to write this loop macro correctly?

    I am trying to write a macro to automate something, but I am really struggling to get all the components in place and the syntax correct....

    I have a large worksheet that uses lookups to fill in the values based on what is in cell AA1
    I have a named range of cells that would be used to set the value of AA1
    For each value in the named range I would like the macro to:

    Set the value of AA1
    Let the sheet calculate
    Copy the worksheet to a new file
    Change the worksheet name to the same value used to set AA1

    So if I had a named range with 5 values I would end up with a separate file with 5 worksheets that were named in line with those 5 values.

    Getting it to do the actual process is OK, but I don't know how to set it up so that is uses the named range, and then runs through until all the values in that range have been used....only know that I need to use a loop of some sort....

    Hope its clear what I am trying to do...

    Thanks

    Andy
    Last edited by cb95amc; 03-11-2009 at 08:43 AM. Reason: Title edit required

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro assistance required please

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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