+ Reply to Thread
Results 1 to 5 of 5

VBA - Running Macro from array / list

  1. #1
    Registered User
    Join Date
    02-07-2011
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    9

    VBA - Running Macro from array / list

    Month End Master Template - example.xlsHi all,

    I hope somebody can help. I have a basic knowledge of VBA (although usually just record macros).

    I have a master spreadsheet which needs to be completed and distributed monthly, containing customer information split in to a number of tabs for various products. All 1000 customers are assigned a regional identifier (like a bank sort code). eg:

    London - 11111
    Southend - 22222
    Portsmouth - 33333

    The identifier for each customers' region is in every tab in the same row as their name.

    One tab in the master spreadsheet contains all region codes.

    I have some macros written already on my master template. My logic...

    Filter each product (each tab) in the master template by first region code (indentifier) in list (DONE)
    Copy filtered info (DONE)
    Open New Work Book (DONE)
    Paste each tab (DONE - long winded, would welcome any quick copy and paste coding)
    Rename each tab in line with master template (DONE - but as above)
    Save workbook with file name "[regional code]" (DONE)

    Repeat for next indentifier/region code in list (THIS)

    In particular, I need the macro to look at the list of region codes one at a time and perform the below functions before moving to the next region code and repeating. It is the last point that I am struggling with!


    Thank you for your help

    Regards
    B
    Last edited by bwhite1986; 02-09-2012 at 10:07 AM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: VBA - Running Macro from array / list

    I suggest you post a small sample workbook.

  3. #3
    Registered User
    Join Date
    02-07-2011
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: VBA - Running Macro from array / list

    Ok, I've attached a doc.
    Thks
    B

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: VBA - Running Macro from array / list

    I'm not entirely sure what you're specifically asking, but you probably want to put your code inside a loop along these lines:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-07-2011
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: VBA - Running Macro from array / list

    So simple when you know how! Thanks very much
    B

+ 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