+ Reply to Thread
Results 1 to 28 of 28

Automatically fill in data based on multiple criteria from another spreadsheet

  1. #1
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Automatically fill in data based on multiple criteria from another spreadsheet

    Hi,

    I am in way over my head and wondering if anyone can help me.

    I have one workbook with 2 tabs (2 worksheets). See attachment, it looks like this:

    First tab:

    3 rows - Client 1, Client 2, Client 3

    12 columns - January 2015 - December 2015

    Second tab:

    3 rows - Client 1, Client 2, Client 3

    2 columns - Monthly Revenue and Start Month

    I want the 1st worksheet to automaticaly fill in the monthly revenues for each client based on the start month listed on the 2nd worksheet. Monthly revenue is always 2 month from the start month.

    I want it to automatically update the data in the first worksheet everytime I add a new client to the 2nd worksheet. Is this even possible?

    At first, I was trying to use MATCH and INDEX, but I really think I need macros.

    I am a newbie and appreciate any help I can get.


    Thanks so much,

    Trinh
    Attached Files Attached Files
    Last edited by TrinhTran02; 02-11-2015 at 06:12 PM.

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: help with macros

    Can you post a bigger dataset? I cant understand how or where the data is coming from.

    I think you can do this without macros, but I need to see the data you are reporting on.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: help with macros

    Hi Trinh,

    I put this event code in sheet 2:

    Please Login or Register  to view this content.
    Try:Trinh.xlsm
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Re: help with macros

    Hi Mike,

    Thanks so much for taking the time out to look at this. I've spent 2 days on it and have no idea what I'm doing!

    See new attachment:

    I want Sheet 1 to pull data from Sheet 2.

    I want the macro to automatically fill in the Sheet 1 to look like Sheet 3.

    The revenue on Sheet 1 should start 2 months after the start month. In the example, Start month of Jan-15, sheet should fill in
    revenue for Mar-15 through Dec-15.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Re: help with macros

    Hi XLAdept,

    I will try it now. Will let you know. Thank you!

    Trinh

  6. #6
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Re: help with macros

    Thank you, but it did not work. I want the revenue to fill in 2 months after the start month. So if Sheet 2 says 15-Jan, then it should start 15-March on Sheet 1. Also I need the rest of the months to be filled in. So if it says 15-Jan on Sheet 2, then 15-Mar through 15-Dec should be filled in on Sheet 1.

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: help with macros

    Replace the event code with this:

    Please Login or Register  to view this content.
    And - Thanks for the rep!
    Last edited by xladept; 02-11-2015 at 05:47 PM.

  8. #8
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Re: help with macros

    Quote Originally Posted by xladept View Post
    Replace the event code with this:

    Please Login or Register  to view this content.
    And - Thanks for the rep!
    It worked for "Client 4", but how do I get it to generate data for the other clients and any new client I add to the sheet?! LOL

  9. #9
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Re: help with macros

    Here's the attachment with the updated code.
    Attached Files Attached Files

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: help with macros

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  11. #11
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Re: help with macros

    hanks for the suggestion. I have renamed my thread (not sure I named it correctly LOL). Hopefully I can get someone to help me! I am so stressed! Here's the link to my thread as you requested: http://www.excelforum.com/excel-prog...ml#post3986322

    Trinh

  12. #12
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Re: help with macros

    Quote Originally Posted by FDibbins View Post
    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    I meant to say Thanks! not "hanks" LOL

    http://www.excelforum.com/excel-prog...ml#post3986322

  13. #13
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Re: help with macros

    XLAdept, any luck?

  14. #14
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Automatically fill in data based on multiple criteria from another spreadsheet

    Thanks for the title change

    For future reference, please send a PM advising that you have made the change, that way we know to check the thread again

  15. #15
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Automatically fill in data based on multiple criteria from another spreadsheet

    Hey Trinh,

    You have to enter all three data before it takes hold - I just added a client 5 with no problem

  16. #16
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Re: Automatically fill in data based on multiple criteria from another spreadsheet

    I'm able to add Client 5 too (thank you ) , but for some reason it's not generating data for Clients 1-3 on sheet 1.... I'm sorry to be such a pain.

  17. #17
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Re: Automatically fill in data based on multiple criteria from another spreadsheet

    Quote Originally Posted by xladept View Post
    Hey Trinh,

    You have to enter all three data before it takes hold - I just added a client 5 with no problem
    Here's the attachment. Clients 1, 2, and 3 doesn't have data.
    Attached Files Attached Files

  18. #18
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Automatically fill in data based on multiple criteria from another spreadsheet

    In Column B you need to reenter the amount (or any column reenter its entry)

  19. #19
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Re: Automatically fill in data based on multiple criteria from another spreadsheet

    Quote Originally Posted by xladept View Post
    In Column B you need to reenter the amount (or any column reenter its entry)
    Thank you!!!! Worked like a charm. You are awesome!

  20. #20
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Re: Automatically fill in data based on multiple criteria from another spreadsheet

    Quote Originally Posted by xladept View Post
    In Column B you need to reenter the amount (or any column reenter its entry)
    Okay, last question. I promise! LOL. See attached highlighted in yellow. What if I want it to fill in for 15-Jan through 15-Dec on Sheet 1 if the start month is "existing" on Sheet 2. I manually added it to the sheet to show you what I need.
    Attached Files Attached Files

  21. #21
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Automatically fill in data based on multiple criteria from another spreadsheet

    Please Login or Register  to view this content.

  22. #22
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Re: Automatically fill in data based on multiple criteria from another spreadsheet

    Quote Originally Posted by xladept View Post
    Please Login or Register  to view this content.
    I used what you taught me to create the attached spreadsheet. It works like a charm and I have all the data loaded. Everything looks good EXCEPT I wanted to test adding a new client. When I try to add a new client now or run the macro, it comes up with an error. I am pretty sure I messed up your code somewhere. Can you take one final look? PLEASE : (
    Attached Files Attached Files

  23. #23
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Automatically fill in data based on multiple criteria from another spreadsheet

    Maybe:

    Please Login or Register  to view this content.
    *But there is no column for 6-15

    ** This is enough different from the sample that we'll probably need to recode it
    Last edited by xladept; 02-12-2015 at 12:50 AM.

  24. #24
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Unhappy Re: Automatically fill in data based on multiple criteria from another spreadsheet

    Quote Originally Posted by xladept View Post
    Maybe:

    Please Login or Register  to view this content.
    *But there is no column for 6-15
    It's adding the New Client in Row 2 instead of Row 56. See attached.
    Attached Files Attached Files

  25. #25
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Automatically fill in data based on multiple criteria from another spreadsheet

    I updated the last post - try it again.

    Signing off for the day

  26. #26
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Re: Automatically fill in data based on multiple criteria from another spreadsheet

    Thanks so much for today LOL. You have been awesome. I will try the new code and let you know.

  27. #27
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Re: Automatically fill in data based on multiple criteria from another spreadsheet

    Quote Originally Posted by xladept View Post
    I updated the last post - try it again.

    Signing off for the day
    It works but it's adding it on row 60, instead of row 56. I was hoping to eliminate the space (empty rows) in between. See attached.

    Talk to you tomorrow - Hopefully! : )
    Attached Files Attached Files

  28. #28
    Registered User
    Join Date
    02-11-2015
    Location
    Dallas
    MS-Off Ver
    2010
    Posts
    20

    Re: Automatically fill in data based on multiple criteria from another spreadsheet

    I really need help. I am a newbie to Excel and Macros. The previous code XLAdept gave me worked, but I changed my spreadsheet so now it's not working anymore.

    See attached spreadsheet:CashFlowExample.xlsm

    I need a code that generates data on Sheet 1 (Cash Flow 2015) based on the data on Sheet 2 (2015 Clients).

    On Sheet 2, if column D says "Annual", then I want the Annual payment Amount (Column C) to generate on the "Expected Payment Date" (Column F) on sheet 1. For example, Boston EMS should generate $68,100 in Apr-15 on Sheet 1.

    if column D says "Monthly", then I want the Monthly payment Amount (Column B) to generate 2 months from the "Start Month" (Column E) through Dec-15 (end of the year). For example, Blanchester EMS should generate $133 Mar-15 through Dec-15.

    Essentially, I want the macro(s) to make Sheet 1 (Cash Flow 2015) to look like Sheet 3. Sheet 3 is only there for display purposes and will be deleted.

    I want the sheet to also:

    - Automatically update Sheet 1 if I add a customer to sheet 2.
    - Automatically update Sheet 1 if I delete a customer on sheet 2.
    - Automatically update Sheet 1 if I change the payment amounts in Columns B or C.
    - Automaticaly update Sheet 1 if I change column D (Annual to Monthly or vice versa).

    Is this going to be possible?

+ 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: 10-02-2013, 09:05 PM
  2. Replies: 5
    Last Post: 07-26-2012, 09:38 PM
  3. Macros: Data cleaning macros not producing expected outputes.
    By bertlogdi1 in forum Excel Programming / VBA / Macros
    Replies: 31
    Last Post: 06-17-2011, 06:52 AM
  4. Replies: 5
    Last Post: 02-17-2010, 02:02 PM
  5. choose default macros Not Enabled / Macros Enable Setting
    By BEEJAY in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2006, 08:10 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