+ Reply to Thread
Results 1 to 5 of 5

Marco to update sheet first and then copy

  1. #1
    Registered User
    Join Date
    09-13-2012
    Location
    GA, USA
    MS-Off Ver
    2010
    Posts
    48

    Marco to update sheet first and then copy

    Hi,

    I'm looking for a macro, that first updates a sheet located in a different file and then copies the updated data to paste in a report file. Below is a macro that I have got so far, but this macro copies data as is without updating Raw data sheet. The Raw data sheet is updated using macro button.

    Any help greatly appreciated. Thanks!
    Please Login or Register  to view this content.
    Last edited by alansidman; 05-07-2018 at 01:59 PM.

  2. #2
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Marco to update sheet first and then copy

    All your macro does is open the raw data sheet and immediately copy the data. I do not see any prove that the raw data is updated. You say raw data sheet is updated with a macro button.

    my guess would be you will have to trigger the macro in the raw data sheet "Raw Data Lookup" to update before you copy.
    I do not know the name of that macro but you can call the macro to action in your code.

    I put a line in red where you should call the macro
    I also cleanup your code from not needed selects and activates.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-13-2012
    Location
    GA, USA
    MS-Off Ver
    2010
    Posts
    48

    Re: Marco to update sheet first and then copy

    You are correct I want to trigger a macro in the "Raw Data Lookup" sheet before I copy the data. I tried your code but its giving me an error, the macro name called out is "UpdateMain" and this is how I called it out...

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Marco to update sheet first and then copy

    Ah yes.. have to call a different way for macro's in other workbook..
    try the code below
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-13-2012
    Location
    GA, USA
    MS-Off Ver
    2010
    Posts
    48

    Re: Marco to update sheet first and then copy

    Awesome, it worked . It takes longer to run the report though, so it proves that it is triggering the macro in other workbook.

    Thank you!!

+ 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: 7
    Last Post: 02-13-2017, 04:51 PM
  2. copy data from one sheet to annother, format it; Update to refect changes on source sheet
    By simplificated in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2013, 03:45 PM
  3. Replies: 0
    Last Post: 09-10-2013, 08:17 AM
  4. Need Marco to review row for an array of codes and update cell with yes or no
    By Robert.Bristow in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-11-2013, 01:24 PM
  5. Marco to get data and also to update table with amendments?
    By rmharrison in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-04-2012, 11:25 PM
  6. Replies: 7
    Last Post: 12-03-2012, 03:10 AM
  7. marco button to update master sheet from multiple workbooks
    By mikeydaman in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-11-2009, 10:45 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