+ Reply to Thread
Results 1 to 4 of 4

How to get Excel to copy a master worksheet incorporating values entered by user

  1. #1
    Registered User
    Join Date
    03-06-2017
    Location
    Portland, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    3

    How to get Excel to copy a master worksheet incorporating values entered by user

    Hello!
    I really love Excel. I recently started using some more advanced formulas and it's giving me some cool ideas, that are stretching beyond my current excel capabilities! I'm trying for the first time to incorporate some VBA into a workbook. Could I ask for your thoughts on how to approach something?

    I've created a master worksheet called Master which is going to include some reporting formulas set up based on a product code. I'm going to set it up so I can enter any product code into A1 and it runs a few formulas to report on that product code. So that will be the easy part, but I'd like to create a macro, or userform, or some automated way for a user to enter in up to 30 product codes into a worksheet called Set Up, and then press a button and Excel automatically creates a new worksheet for each product code. I want it to copy my Master worksheet and name it the product code, and also enter the product code into cell A1 within the new worksheet. Then I'd like a Reports worksheet to populate with a few values from each of the 30 worksheets (up to 30).

    Should I be using Userforms for this? What are some of the basic codes to initiate a new worksheet, name it, transfer a value into it, and then include results from that sheet in a report? It's confusing - how can I pre-configure a Report worksheet if I won't know ahead of time what the product codes will be and exactly how many there will be (only the max number)?

    I attached a rough skeleton of what I'm planning. I'm using Excel 2010. Any help would be amazing. I'm finding a few sites out there with some tips for this type of thing, but it's never quite exactly what I'm doing and I'm beginning to think that might take a while just hacking through it! This project has been fun.
    Todd
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How to get Excel to copy a master worksheet incorporating values entered by user

    Hi Todd, welcome to the forum.
    I like your enthusiasm and praise your intentions, go for it, Excel and especially VBA is great.
    All you need is a lot of time a very patient partner, a lot of patience and perseverance.

    I've read what you are asking. I downloaded the file and will take a look at it later today maybe this evening to see if I can grasp what you are wanting to achieve.

    Maybe someone else picks it up too, there quiet a few a guys here on this forum that like these things too.

    Regards,
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: How to get Excel to copy a master worksheet incorporating values entered by user

    Hi tsummers and welcome to the forum,

    I think you are looking for a Pivot Table or an Advanced Filter solution for your first step. See the attached where I've done a PT on your left table. I believe using VBA to create new sheets isn't a great idea. Learn PTs and see if that is all you need.

    Product PT filtered.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    03-06-2017
    Location
    Portland, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: How to get Excel to copy a master worksheet incorporating values entered by user

    Hi there,
    Thanks for the welcome Keebellah, and Marvin I like your idea of the PivotTable! I think that gives me some cool possibilities, but I think my main challenge is how to enable the user to enter the product codes of their choice and then get Excel to run all my formulas on the Master sheet based on their entry. Part of why I was going the route of getting Excel to spawn new worksheets for each product code (copying the Master) is that Master worksheet has a bunch of formulas with multiple steps - it needs to take their product code and search for it within multiple worksheets where the user will be importing sales data, email marketing data, and perhaps other data. Where it finds the product code it will return corresponding data like dates, order totals, etc. Then it runs some more analysis of that data which is what I want to eventually summarize on a Reports worksheet. So while the Pivot Table seems useful for filtering data to investigate trends in my dataset I'm not sure that it will help me to do this analysis that's drawing in values from multiple sources and performing numerous formulas based on those values.

    Another key is that I'd like to set up some sort of automation so this can be used by different people within my company with various levels of expertise with Excel. So ideally I'd like them to just enter the date of the email send, the product code, and maybe a few other things and click "go" and have Excel do the calculations and reports without requiring the user to do any further data manipulation to interpret the results.

    Here's what I want Excel to do automatically:

    1) Enable a user to enter in their date/product codes on one sheet
    2) Run the same list of calculations for each date/product code (referring to multiple worksheets containing source data inputed by the user)
    3) Then capture certain resulting values from each of those calculations for a final report reflecting all the date/product codes

    Perhaps you're right that creating new worksheets isn't necessary. My plan was to get VBA to initiate new worksheets based on the users input, name the sheets, transfer certain values into each sheet, and then refer to the calculated results from those sheets in a report. But maybe that's over engineering it.

    Thanks so much!
    Todd
    Last edited by tsummers; 03-06-2017 at 07:28 PM.

+ 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. Replies: 1
    Last Post: 07-11-2015, 11:20 AM
  2. Macro to auto copy entire row from master to worksheet based on column values
    By danielleferry in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-20-2014, 11:22 AM
  3. Replies: 1
    Last Post: 05-15-2013, 09:51 PM
  4. Open a excel userform with values previously entered by user using VBA
    By anuraag1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-17-2013, 07:02 AM
  5. Need to copy specific cells into an existing worksheet based on date entered by user
    By jrfleury in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-17-2011, 09:44 AM
  6. Replies: 0
    Last Post: 08-15-2007, 06:40 AM

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