+ Reply to Thread
Results 1 to 21 of 21

vba excel update outside files using Mumps1 code altered.

  1. #1
    Registered User
    Join Date
    04-29-2019
    Location
    Iowa, United States
    MS-Off Ver
    2016
    Posts
    16

    vba excel update outside files using Mumps1 code altered.

    Hey Mumps1 shared this code which works perfect in its original form within the workbook,

    My question for the code Mumps1 shared is, I was wondering if it would be possible to tweak it to work with updating an outside workbook?

    I have tried to alter your code but keep getting errors, currently I getr an overflow error but if I declare v1 and v2 as Long then I get an Expected array message..... This is how I tweaked it for this purpose but not sure where my mistake is.

    Basically I want to take the columns "B, C, T" when matched from "Ws" and paste to "Nws"

    Please Login or Register  to view this content.

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

    Re: vba excel update outside files using Mumps1 code altered.

    What is in B9 of the "File Locs" sheet?
    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
    04-29-2019
    Location
    Iowa, United States
    MS-Off Ver
    2016
    Posts
    16

    Re: vba excel update outside files using Mumps1 code altered.

    its an address to the external file

    The external file is basically the Data sheet which matches the format of the today sheet from my origional workbook.

    You can see it on the origional file i posted on the "File Locs" sheet

    But simply put the File Location and name of the file to open.
    Last edited by cizzett; 04-29-2019 at 04:29 PM.

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

    Re: vba excel update outside files using Mumps1 code altered.

    Could you post both files?

  5. #5
    Registered User
    Join Date
    04-29-2019
    Location
    Iowa, United States
    MS-Off Ver
    2016
    Posts
    16

    Re: vba excel update outside files using Mumps1 code altered.

    Here you go Mumps1,
    The Public File is my source file like the one you helped me with already, the 2019 Qlty Data Public is the source file I want to update with column B, C, and T when they match the key in column A
    Attached Files Attached Files

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

    Re: vba excel update outside files using Mumps1 code altered.

    Place this macro in a standard module in the Public workbook and run it from there:
    Please Login or Register  to view this content.
    Last edited by Mumps1; 04-30-2019 at 10:03 AM.

  7. #7
    Registered User
    Join Date
    04-29-2019
    Location
    Iowa, United States
    MS-Off Ver
    2016
    Posts
    16

    Re: vba excel update outside files using Mumps1 code altered.

    I keep getting the overflow error

    2019-04-30_09h08_49.png

  8. #8
    Registered User
    Join Date
    04-29-2019
    Location
    Iowa, United States
    MS-Off Ver
    2016
    Posts
    16

    Re: vba excel update outside files using Mumps1 code altered.

    Mybe this is a lost cause


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

    Re: vba excel update outside files using Mumps1 code altered.

    Please try the modified code in Post #6. In the meantime, I'll have another look at the macro.

  10. #10
    Registered User
    Join Date
    04-29-2019
    Location
    Iowa, United States
    MS-Off Ver
    2016
    Posts
    16

    Re: vba excel update outside files using Mumps1 code altered.

    So using your code it now runs without error but doesn't seem to update anything

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

    Re: vba excel update outside files using Mumps1 code altered.

    Try:
    Please Login or Register  to view this content.
    Just to confirm: you want the data from the Today sheet to be copied to the Data sheet. Is that correct?

  12. #12
    Registered User
    Join Date
    04-29-2019
    Location
    Iowa, United States
    MS-Off Ver
    2016
    Posts
    16

    Re: vba excel update outside files using Mumps1 code altered.

    Still no go, using these two records as a reference should easily see it update but everything seems to flow fine just doesn't actually update anything.


    2019-04-30_09h49_01.png

  13. #13
    Registered User
    Join Date
    04-29-2019
    Location
    Iowa, United States
    MS-Off Ver
    2016
    Posts
    16

    Re: vba excel update outside files using Mumps1 code altered.

    and yes your correct, it opens the data sheet just doesn't overwrite B, C, or T with the new info from Today sheet

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

    Re: vba excel update outside files using Mumps1 code altered.

    I think I have found the problem but I have to go out now. I will get back to you as soon as I can.

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

    Re: vba excel update outside files using Mumps1 code altered.

    Try:
    Please Login or Register  to view this content.
    I noticed that the value "XH003810211-2021-01ZY" is duplicated in the Data sheet in A171 and A385. There may be others. I'm not sure how you want to handle duplicate values in the Data sheet.

  16. #16
    Registered User
    Join Date
    04-29-2019
    Location
    Iowa, United States
    MS-Off Ver
    2016
    Posts
    16

    Re: vba excel update outside files using Mumps1 code altered.

    Well, preferably it would just update the last entry as it would be the latest occurence

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

    Re: vba excel update outside files using Mumps1 code altered.

    In that case try:
    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    04-29-2019
    Location
    Iowa, United States
    MS-Off Ver
    2016
    Posts
    16

    Re: vba excel update outside files using Mumps1 code altered.

    OMGoodness, this seems to be it!!!!!!!

    You are freaking amazing buddy!!!!!!

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

    Re: vba excel update outside files using Mumps1 code altered.

    Glad we finally got there.

  20. #20
    Registered User
    Join Date
    04-29-2019
    Location
    Iowa, United States
    MS-Off Ver
    2016
    Posts
    16

    Re: vba excel update outside files using Mumps1 code altered.

    You are awesome, I truly appreciate the help I have been stumped on this one for a while now and no one could seem to give me a direction.

    Thanks again truly

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

    Re: vba excel update outside files using Mumps1 code altered.

    You are very welcome.

+ 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. Auto update list of files with VBA code?
    By ASDVW1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-12-2017, 05:36 PM
  2. Synchronise 2 worksheets , VBA code to update in both files.
    By stevnb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-20-2012, 09:41 AM
  3. update vba code in multiple files
    By opinion in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-27-2011, 08:23 AM
  4. Automatic update excel files
    By bubbelhund in forum Excel General
    Replies: 0
    Last Post: 10-07-2008, 07:57 AM
  5. [SOLVED] Excel should update trendline equations when data is altered.
    By crystal in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-04-2006, 05:20 PM
  6. Update Code to work between 2 files
    By dkenebre in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-12-2005, 10:34 AM
  7. [SOLVED] can not save altered files over network
    By DF2000 in forum Excel General
    Replies: 0
    Last Post: 03-08-2005, 09:06 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