+ Reply to Thread
Results 1 to 3 of 3

Help with code to determine which sheets to import using user input

  1. #1
    Registered User
    Join Date
    10-21-2014
    Location
    Kansas City, MO
    MS-Off Ver
    2010
    Posts
    2

    Help with code to determine which sheets to import using user input

    Hello-

    I'm very new to excel vba and am self-taught, so I apologize for any silly questions in advance.

    I have multiple contractors who submit invoices to me monthly in separate spreadsheets, and I am writing a macro that copies from those spreadsheets in to a new master spreadsheet where each contractor has their own tab. I do not need to do this for every contractor every month, however, so I set up a listbox with each contractor's name so that I can select which ones I want the macro to execute for.

    Here's my problem: I have several dozen contractors, and the only way I know of to tell the macro which contractors I want the code to execute for is by using several dozen If functions. Is there a different way to do this?

    Thank you!

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Help with code to determine which sheets to import using user input

    Would using Select/Case work better for you?

  3. #3
    Registered User
    Join Date
    10-21-2014
    Location
    Kansas City, MO
    MS-Off Ver
    2010
    Posts
    2

    Re: Help with code to determine which sheets to import using user input

    Thanks for the idea! That would have worked well, but I ended up using a For Loop.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Code for Merge Multi Sheets using user input
    By Liz_Biz in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-29-2013, 03:18 PM
  2. [SOLVED] How to determine if the user input a STRING or an INTEGER?
    By mcmunoz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-26-2013, 10:32 PM
  3. Allow user to input directory to import from
    By Grekazor in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-13-2010, 07:40 PM
  4. Pause macro for user input then search for user's answer across multiple sheets
    By sassy2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-04-2009, 03:55 AM
  5. Import Oracle Data from user input
    By octithorp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-10-2005, 04:06 PM

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