+ Reply to Thread
Results 1 to 5 of 5

Transfer data from Userform to multiple spreadsheets

  1. #1
    Registered User
    Join Date
    09-12-2014
    Location
    ON, Canada
    MS-Off Ver
    2007
    Posts
    24

    Transfer data from Userform to multiple spreadsheets

    Hello wonderful Exel Champions,

    I have a spreadsheet that uses two "if then" criteria to transfer data to the correct sheet. I am now looking to add a third. The user specifies a month and a category for the data in the userform to transfer to. I would like to add a "recurring" option. For expenses that stay the same every month. So when you check the "recurring" checkbox you wouldn't add any information in the "month" option. The data flows to all of the months in that category. Userform.GIF. The macro is already so long that I had to separate the info into two 6 months userforms. Is there an easy way to do this without adding another 1000 lines of code.
    Attached Files Attached Files

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Transfer data from Userform to multiple spreadsheets

    My version replaces almost all of your code in the commandbutton click event.

    A few things:
    1. The reoccuring function only goes to the end of the year since your sheets only appear to be yearly. If you put a date that is at the end of the month, the code does not check for this and will happily try to put a date of February 31st if you start in January. If this need to be addressed, we can revisit later. I just wanted to give you a feel for what I added.
    2. I added a Class Calendar popup. This class module works across all versions of Excel, unlike the calendar controls put out by MS, which seem to be on again, off again between versions. You'll have to drag the class and the Userform1 over to your sheet, if you want to use this.
    3. You'll have to make sure your Sheet naming conventions all follow GL-MMM, a three letter month. I noticed a GL-SEPT in your example.
    4. This userform will take ALL months for the year in one userform.
    5. If you happen to put a out-of-season date in, the code will just not store the data. There's no checking to make sure you're in the right year. Again, we can address that later.
    Attached Files Attached Files
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    09-12-2014
    Location
    ON, Canada
    MS-Off Ver
    2007
    Posts
    24

    Re: Transfer data from Userform to multiple spreadsheets

    Thanks Tinbendr,

    I don't think that's quite what I'm looking for, more likely I can't get it to work. I can get to the calendar, but not sure what it does. I double click on a day and a blank userform in VBA opens, how do I input data? I did forget to mention that the it's fine if the "Date" data is incorrect, when recurring is selected.

    I really appreciate your time.

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Transfer data from Userform to multiple spreadsheets

    I can get to the calendar, but not sure what it does. I double click on a day and a blank userform in VBA opens, how do I input data?
    So, you double-click on the date field, a calendar pops up, you select a day, then a blank userform shows? That's really odd!?!?!?!?!?!? I even d/l the sheet here at home, but it works fine.

    I did forget to mention that the it's fine if the "Date" data is incorrect, when recurring is selected.
    The way I have it written now, it does make a difference. It takes the date you enter, and starts a loop from that month to the end of the year.

    So, If you entered 8/7/2014, the code runs a loop from 8-12, inserting 8/7, 9/7, 10/7, 11/7 and 12/7. If you enter a date that represents the last day of the month, Say Jan 31, then you'll have Feb 31, Mar 31, Apr 31... Excel won't care because it will convert the Feb date to Mar 3, on the Feb Sheet.

    I think I have the EOMonth thingy worked out.

    I also added a short Sub in a standard module so you can call the userform with a Alt-F8 instead of from the editor.
    Attached Files Attached Files
    Last edited by Tinbendr; 01-24-2015 at 12:03 PM.

  5. #5
    Registered User
    Join Date
    09-12-2014
    Location
    ON, Canada
    MS-Off Ver
    2007
    Posts
    24

    Re: Transfer data from Userform to multiple spreadsheets

    I still can't get this to work. I hit Alt+f8 (macros enabled), I fill out every line, then submit. And the data doesn't transfer regardless if I select recurring or not.

    Thanks

+ 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] Transfer data to multiple spreadsheets - Accounting
    By KLG519 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-02-2014, 02:17 PM
  2. transfer data between multiple spreadsheets
    By ravidhiman in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-26-2014, 07:03 PM
  3. combining chart userform and data transfer userform into 1 userform
    By H_Kennedy in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-04-2014, 07:11 AM
  4. combining chart userform and data transfer userform into 1 userform
    By H_Kennedy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-03-2014, 12:28 PM
  5. [SOLVED] VBA for Option Button on Userform to send data to Multiple Spreadsheets
    By rcfrench in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-08-2013, 11:43 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