+ Reply to Thread
Results 1 to 6 of 6

Copy Data From Workbook

  1. #1
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Jacksonville, Fl
    MS-Off Ver
    Excel 2016
    Posts
    355

    Copy Data From Workbook

    Hello,

    I'm slowly learning VBA but have not have not been able to accomplish what I'm trying to do with this project. Here is the little amount of code I have so far.

    Please Login or Register  to view this content.
    I'd like for the macro to paste data for the day before its ran. For example: If I run the macro on the Sunday(6/2/2013), I'd like the data for Saturday(6/1/2013). Or if the macro is ran on Monday(6/3/2013) but there is no data for Sunday(6/2/2013) I'd like it to skip to Saturday(6/1/2013) (or the first date with data).

    The dates are in "A" and the rest of the data is in "B", "C", "D" (data.xlsm).

    I hope this makes sense, I did my best to explain.

    Anyone that can help me out with this I would appreciate it a lot.

    Thank you,

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy Data From Workbook

    You will need to explain some more. Where would the date be mentioned so we know its pulling the date for the previous day?

    Do you have a sample file that you can upload?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Jacksonville, Fl
    MS-Off Ver
    Excel 2016
    Posts
    355

    Re: Copy Data From Workbook

    arlu1201,

    Here are two samples. The data workbook contains the dates and data I want to copy from. The piechart workbook is where I would like the data to be pasted (replace current date and data).

    Thank you for your reply and I hope this helps,
    Last edited by Justair07; 06-05-2013 at 08:46 PM. Reason: Remove samples

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy Data From Workbook

    How about this - ?

    You specify the date in Pie Chart D2 and the macro pulls up the values for you?

    If you specify the date, you do not need a macro. Even a vlookup can pull up the data for you.

  5. #5
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Jacksonville, Fl
    MS-Off Ver
    Excel 2016
    Posts
    355

    Re: Copy Data From Workbook

    The VLookup is almost perfect! But what if new data is entered, is there a way to refresh the vlookup so if I add a line of data it will automatically pick up in the vlookup?

    Thank you again for your help!

  6. #6
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Jacksonville, Fl
    MS-Off Ver
    Excel 2016
    Posts
    355

    Re: Copy Data From Workbook

    I just realized that Vlookup will update once I reopen the workbook. Thank you for your help on this. Much easier than my approach.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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