+ Reply to Thread
Results 1 to 23 of 23

Update workbook from another using upload button

  1. #1
    Registered User
    Join Date
    01-25-2017
    Location
    Worcester
    MS-Off Ver
    2016
    Posts
    93

    Update workbook from another using upload button

    I need a way of creating a form within a workbook which has multiple boxes to enter data into and for each box that data is entered into it corresponds to cells on another workbook which updates automatically when saved OR with an Update button on the form that forces it to update the 2nd workbook cells.
    Example are attached (unable to upload attachments for some reason so see images as examples). The form workbook will be filled and the data needs to be transfered onto the results spread sheet.

    Is this possible?

    Form.JPGresults.JPG
    Attached Files Attached Files
    Last edited by smudgers9; 11-23-2017 at 11:38 AM.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Update workbook from another using upload button

    To attach files, click on 'Go Advanced' and then scroll down and click 'Manage Attachments'.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    01-25-2017
    Location
    Worcester
    MS-Off Ver
    2016
    Posts
    93

    Re: Update workbook from another using upload button

    Attached, thanks

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Update workbook from another using upload button

    Still no attachments!!

  5. #5
    Registered User
    Join Date
    01-25-2017
    Location
    Worcester
    MS-Off Ver
    2016
    Posts
    93

    Re: Update workbook from another using upload button

    Screenshot.JPG
    I can see them

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,522

    Re: Update workbook from another using upload button

    This should do the job if both workbooks are open and the code is ran from "Form.xlsm"
    You have to put the code in a regular module and save the file as an xlsm file.
    Please Login or Register  to view this content.

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Update workbook from another using upload button

    My apologies. I didn't notice that you placed the attachments in your original post. Try the attached files. I made a few small changes to each file. I protected the Survey Form so that only the cells that need input are accessible and I made a minor change in row 1 of the results workbook. Make sure that both workbooks are open. Make an entry in one of the fields in the Survey Form and exit the cell. The data will be automatically copied to the Results workbook.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-25-2017
    Location
    Worcester
    MS-Off Ver
    2016
    Posts
    93

    Re: Update workbook from another using upload button

    Amazing Mumps1 that worked perfectly. Really appreciate your help.

    Thanks Jolivanes too for your efforts.

  9. #9
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Update workbook from another using upload button

    You are very welcome.

  10. #10
    Registered User
    Join Date
    01-25-2017
    Location
    Worcester
    MS-Off Ver
    2016
    Posts
    93

    Re: Update workbook from another using upload button

    Hi Mumps1, apologies for looking for further assistance but I need this script to do a little bit more.
    It works perfectly but what I need it to do is when Form.xlsm\sheet 1 is updated for example it only adds data to cells in row 4 in the results workbook. Then when sheet2 is updated it only adds data to row 5 and so on. Is this possible?

  11. #11
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Update workbook from another using upload button

    I'm not sure what you mean. I believe the macro already does that. Currently the macro will add data to the first blank row of Sheet1 of the Results workbook. So the first time you fill in the survey form, the data will be copied to row 4. The second time you complete the survey form, the data will be copied to row 5 and so on. When you say
    Then when sheet2 is updated
    we're not using any sheet named Sheet2. Could you please clarify? Also you must keep in mind that the way the macro is written, you must make sure that every field in the survey form is filled in every time. There must be no blank fields. If there is a possibility that even one field of the survey form will be blank , I will have to modify the macro. Please let me know.

  12. #12
    Registered User
    Join Date
    01-25-2017
    Location
    Worcester
    MS-Off Ver
    2016
    Posts
    93

    Re: Update workbook from another using upload button

    Sorry if I wasn't clear.
    You're right that is what it does. But what I have created are 63 seperate sheets that all relate to a seperate form. Each will be filled in at key times and the data transfered to the results spread sheet. What I want is for Sheet 1 to only update row 4 and sheet 2 to only update row 5 and so on. At the moment if I type a wrong word in one of the cells on sheet1 and press tab then go back to amend it, the results workbook will have 2 entries for both of the words in rows 4 and 5. I need it to be more locked down.
    Does this make more sense?

    See my attached spread sheets. They are designed that when saved in the same location if you open Forms.xlsm it will open Results.xlsx at the same time.
    Attached Files Attached Files
    Last edited by smudgers9; 11-27-2017 at 10:21 AM. Reason: More info

  13. #13
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Update workbook from another using upload button

    Try the attached file. You will notice that I removed all the macros in each individual worksheet code module and instead placed one macro in the code module for ThisWorkbook which will apply to all worksheets except "ECP Form". Please note that this macro is based on the current sheet name and sheet codename structure in the Form.xlsm workbook. If this changes in any way, the macro very likely won't work as expected.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    01-25-2017
    Location
    Worcester
    MS-Off Ver
    2016
    Posts
    93

    Re: Update workbook from another using upload button

    Yet again you've nailed it. I had to make a few minor changes to get it perfect but wouldn't have been able to work it out without your assistance. Tahnks again Mumps1.

  15. #15
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Update workbook from another using upload button

    My pleasure.

  16. #16
    Registered User
    Join Date
    01-25-2017
    Location
    Worcester
    MS-Off Ver
    2016
    Posts
    93

    Re: Update workbook from another using upload button

    Sorry Mumps1 I'm back again.

    Now I'm not sure this is even possible and I'll try my best to explain.
    With the existing documents you have resolved for me I need a button that opens a Visio document. That's easy enough as I have done this but I need it to be more intuative.

    As you can see when I press the "Launch Site Survey Form" button it unhides a sheet and there are 65 hidden in total. Once the Site name field is filled in it renames the Sheet to whatever the name of the site is. Simple so far.
    What I would like is a button on each of these sheets that when pressed opens a visio document with the same name as the sheet which contains a floor plan of that particular site. So for example if I named the sheet Worcester, when the button is pressed Worcester.vsd opens. If I name the next sheet London, london.vsd opens.

    Is this at all possible? See example documents and you can see what I have tested so far. (unable to upload .vsd file so have uploaded a PDF as it will be the same priciple just a different application)
    Attached Files Attached Files

  17. #17
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Update workbook from another using upload button

    Try the attached file.
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    01-25-2017
    Location
    Worcester
    MS-Off Ver
    2016
    Posts
    93

    Re: Update workbook from another using upload button

    As always Mumps1 you've nailed it on the head. Works like a dream. I have tweaked it a little and added even more things to it but it now does what I need. Hopefully you won't hear from me again. Really appreciate your assistance with this.

  19. #19
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Update workbook from another using upload button

    Always glad to help out.

  20. #20
    Registered User
    Join Date
    01-25-2017
    Location
    Worcester
    MS-Off Ver
    2016
    Posts
    93

    Re: Update workbook from another using upload button

    Hi Mumps1,

    As discussed here are my documents. What is happening is when you click the "Launch Kradle Form" button on the ECP Form tab in the Forms.xlsm document it unhides a tab as desired. By selecting a Site Name from the appropriate drop down at the top of the new unhidden form and pressing enter it renames the tab to the name selected. This then adds a new line to the results sheet and any subsequent information added to the form is also transfered to the same row in the result sheet.
    BUT it only lets me do this up to the 8th sheet. As soon as I unhide and amend the 9th sheet and onwards it starts going back to row 4 in the results sheet overwriting the information already entered. I need it to just continue down the results sheet with every sheet unhidden in the form.xlsm.
    I have unhidden sheet 8 so test by selecting a Site name. This will create a new row in the results sheet. Then unhide sheet 9 and see that it starts to overwrite previous info in row 4.
    Hope this makes sense.
    Attached Files Attached Files
    Last edited by smudgers9; 02-07-2018 at 06:08 AM.

  21. #21
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Update workbook from another using upload button

    After looking at the Form file, I thought it might be better to simplify it. Rather then having a large number of hidden sheets that you would call up when needed, this version of the workbook has a blank template of the Survey Form which will be copied as needed and then filled out. As it is filled out, the Results sheet will be populated. This eliminates a lot of unnecessary code and also fixes the problem you described. Give it a try and see what you think.
    Attached Files Attached Files

  22. #22
    Registered User
    Join Date
    01-25-2017
    Location
    Worcester
    MS-Off Ver
    2016
    Posts
    93

    Re: Update workbook from another using upload button

    Hi Mumps1,

    I like this amendment, works much nicer than my original. I have included this along with the rest of my code and it's working a treat. I've amended it to change the tab colour and name the new sheet "New Form" which suits my requirements. Thanks again for your help and knowledge.

  23. #23
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Update workbook from another using upload button

    My pleasure.

+ 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] How to upload a file using a command button?
    By Brooksdt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-01-2017, 07:33 PM
  2. Protected workbook, update filter with a button?
    By adamgm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2015, 03:32 PM
  3. How to create a button that upload pdf Object to the active excel spreadsheet?
    By Talk_4 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2015, 06:20 PM
  4. Open another excel file and copy data to sheet 2 while button upload is in sheeet 1
    By rflorentino in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-27-2014, 08:47 PM
  5. Command Button to Update Workbook from External Workbook
    By QCBeauty in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2009, 07:19 AM
  6. Upload Workbook to FTP ???
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-18-2006, 07:35 PM
  7. upload data from an excel worksheet to SQL W/ a command Button
    By cdneely in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2005, 12:20 PM

Tags for this Thread

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