+ Reply to Thread
Results 1 to 4 of 4

Macro to create a new spreadsheet according to a sales rep data

  1. #1
    Registered User
    Join Date
    10-11-2017
    Location
    Hong Kong
    MS-Off Ver
    2019
    Posts
    55

    Macro to create a new spreadsheet according to a sales rep data

    Dear all,

    Attached the sample excel file. I have a raw data spreadsheet which contains three columns (Customer, sales and sales rep). I want to draw the data according to different sales rep and copy to a new spreadsheet and the spreadsheet name is the sales rep name (e.g. David). Afterwards, I need to save each spreadsheet in a directory. The directory location should be C:\(Sales rep name)\(Sales rep name).xlsx (e.g. C:\David\David.xlsx). The sales rep folder assume is already created. Is it possible to do this with macro?

    Your help would be greatly appreciated.

    Best Regards
    Jack
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Macro to create a new spreadsheet according to a sales rep data

    This should do it. I have a couple of modifications.

    1. I put the data into an excel table and made a pivot table off of it. The excel table always knows how much data it has, so the pivot table will always reference the correct amount of data.

    2. The pivot table itself is a unique list of salesperson's names. When you add a new agent, the pivot table will automatically refresh.

    I made this a two-step process. Step 1 is to make the sheets. Step 2 is to copy them.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    10-11-2017
    Location
    Hong Kong
    MS-Off Ver
    2019
    Posts
    55

    Re: Macro to create a new spreadsheet according to a sales rep data

    Yes! It works well! Thanks for your kindly help!

  4. #4
    Registered User
    Join Date
    10-11-2017
    Location
    Hong Kong
    MS-Off Ver
    2019
    Posts
    55

    Re: Macro to create a new spreadsheet according to a sales rep data

    Hi,

    After doing some testing, I found there is a new issue.

    I added a new column 'DATE' between 'SALES' and 'SALESREP' and added one raw data row (Row 13) and have modified some codings to get the results.

    However, I found that if it has same "CUSTOMER' under one 'SALESREP' in different row (e.g. row 12&13) in the table, the pivot table will sum up them but not separate them.

    After clicking 'Make Sheets" button, the expected result I want is 'Charles (Expected)' worksheet, 'Charles' worksheet may not be the result I want.

    Attached the adjusted file. Once again thanks for your kindly help.
    Attached Files Attached Files

+ 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. Would like help to create a sales spreadsheet
    By matkinsell in forum Excel General
    Replies: 1
    Last Post: 09-17-2016, 05:02 PM
  2. [SOLVED] How to create an ongoing sales spreadsheet that also auto-generates monthly breakdowns?
    By ConceivablyPerfect in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-25-2015, 07:10 PM
  3. Replies: 7
    Last Post: 11-24-2015, 01:06 AM
  4. Replies: 2
    Last Post: 09-01-2015, 12:43 PM
  5. Sales Spreadsheet- create results tabs
    By esuhcs in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2012, 05:37 PM
  6. Macro to create statement of sales Ledger
    By Benjamin2008 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 08-15-2011, 06:15 AM
  7. [SOLVED] Create Macro to Copy Data from one spreadsheet to another
    By Cheri in forum Excel General
    Replies: 19
    Last Post: 07-21-2006, 06:00 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