+ Reply to Thread
Results 1 to 6 of 6

Export and sort data depending on dates from one book to another.

  1. #1
    Registered User
    Join Date
    11-26-2018
    Location
    Sweden
    MS-Off Ver
    2016
    Posts
    39

    Export and sort data depending on dates from one book to another.

    Hi,
    I have two excel documents, "Book1" and "Book2". Book1 is exported from our business system. Book2 is a compilation of forecast from the business system data that were exported.

    Today I have to manually put in the data from Book1 to Book2. I want to put a VBA Code in Book2 to import data from Book1 and automate that process.

    In Book2 I have dates in row 25 like dec-18, jan-19, feb-19 and so on. I want these dates to be matched with the dates in Book1 that are displayed as 2019-01-05 and so on, which are displayed vertically in column S. I want the row 25 in Book2 to go to Book1 and match the dates, and if it gets a match I want it to put the data from Book1 column R associated with that date in same row, in the column associated with that date on Book2. Could someone help me do this ��
    For example 6.414.992 should automaticly be input in jan-19 in Book2 row 29(yellow field). Could someone help me do this
    Attached Images Attached Images
    Last edited by lababa; 11-26-2018 at 10:12 AM.

  2. #2
    Registered User
    Join Date
    11-26-2018
    Location
    Sweden
    MS-Off Ver
    2016
    Posts
    39

    Re: Export and sort data depending on dates from one book to another.

    The total sum at the end of Book1 doesn't have to be inputted in Book2

  3. #3
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,513

    Re: Export and sort data depending on dates from one book to another.

    Perhab
    Please Login or Register  to view this content.
    Last edited by daboho; 11-26-2018 at 08:20 AM.

  4. #4
    Registered User
    Join Date
    11-26-2018
    Location
    Sweden
    MS-Off Ver
    2016
    Posts
    39

    Re: Export and sort data depending on dates from one book to another.

    Hi,

    Thank you for your answer. I pasted the code in a Module in excel, it says subscript out of range and highlights "Set wb2 = Workbooks("Book2.xls")". I changed some of the code. The worksheet I'm trying to paste the code in is Sheet2. The workbook I try to export data from is Book2.xls. Both of the files are on the desktop.

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,513
    Quote Originally Posted by lababa View Post
    Hi,

    Thank you for your answer. I pasted the code in a Module in excel, it says subscript out of range and highlights "Set wb2 = Workbooks("Book2.xls")". I changed some of the code. The worksheet I'm trying to paste the code in is Sheet2. The workbook I try to export data from is Book2.xls. Both of the files are on the desktop.

    Please Login or Register  to view this content.
    Perhab wrong your sheet.name
    Or range position
    You can check using msgbox
    And both workbook must to open
    "Presh Star Who has help you *For Add Reputation!! And mark case as Solve"

  6. #6
    Registered User
    Join Date
    11-26-2018
    Location
    Sweden
    MS-Off Ver
    2016
    Posts
    39

    Re: Export and sort data depending on dates from one book to another.

    Hi, It now says "Run-time error '1004': No cells were found." and highlights "For Each r In ws1.Columns("s").SpecialCells(2).Cells"
    As I described earlier I would like to paste this code in the same sheet as I want to import information to. So I want this sheet to import information from Book2.xls. Sorry if i confused you

    Correct me if I'm wrong, but I think this codes takes info from the sheet I paste the code in.
    Last edited by lababa; 11-26-2018 at 09:26 AM.

+ 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. match dates to export data to row
    By BC TIPPING in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-12-2015, 05:08 PM
  2. collecting data from another book if dates match
    By D_M_S in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-23-2014, 05:41 PM
  3. Export Address Book via Macro
    By racer25 in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 07-17-2013, 03:32 AM
  4. [SOLVED] Return Dates From Row 1 depending upon the data in rows beneath...
    By lifeisaspreadsheet in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-08-2012, 02:13 AM
  5. Macro to import data from different work book and sort
    By jerry499 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-11-2012, 08:34 PM
  6. How do I sort and export data from one spreadsheet to three others
    By sdipietro in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2007, 03:35 PM
  7. [SOLVED] Export Excel data to Lotus Notes 6.5 Address Book
    By linz fiske in forum Excel General
    Replies: 0
    Last Post: 09-21-2005, 06:05 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