+ Reply to Thread
Results 1 to 17 of 17

copying data from one workbook to another workbook using date as citeria

  1. #1
    Registered User
    Join Date
    01-27-2017
    Location
    INDIA
    MS-Off Ver
    2016
    Posts
    90

    copying data from one workbook to another workbook using date as citeria

    Hi,

    i am trying to copy data from one workbook to anther workbook between two date range.

    if i have data in source.xlsm , i have created two date fields in excel with button . i select dates as starting date and end date and click of a button the date in source workbook should copy to destination.xlsm workbook. i am tryng something below but its not working.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,191

    Re: copying data from one workbook to another workbook using date as citeria

    Hi narsing18

    Difficult without sample uploads of your files....
    This is the jist of it...However untested...
    Do not like the activesheet.paste method so need more information to improve...
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    01-27-2017
    Location
    INDIA
    MS-Off Ver
    2016
    Posts
    90

    Re: copying data from one workbook to another workbook using date as citeria

    @sintek ,

    First Thanks for the reply.

    i am getting error sort method of range class failed

    Please Login or Register  to view this content.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,191

    Re: copying data from one workbook to another workbook using date as citeria

    As I said....
    Difficult without sample uploads of your files....

  5. #5
    Registered User
    Join Date
    01-27-2017
    Location
    INDIA
    MS-Off Ver
    2016
    Posts
    90

    Re: copying data from one workbook to another workbook using date as citeria

    Please find attachments here TTM_form is the source file and database is the destination file
    Attached Files Attached Files

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,191

    Re: copying data from one workbook to another workbook using date as citeria

    Are you sure you uploaded the correct file....TTM_Form!!!!

  7. #7
    Registered User
    Join Date
    01-27-2017
    Location
    INDIA
    MS-Off Ver
    2016
    Posts
    90

    Re: copying data from one workbook to another workbook using date as citeria

    Yes that is correct file only..in TTM_Form i want to copy "Data Sheet" sheet to data_base workbook if its hidden you can un-hide using password "extn@123"

    there is a button in the main screen as admin
    Last edited by narsing18; 07-25-2017 at 06:55 AM.

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,191

    Re: copying data from one workbook to another workbook using date as citeria

    K got it.... I seriously would suggest Your clock in table to have date separate from time , else you will have to create a dummy column with date only for filter purposes.

    Edited...
    I put in an extra column F for date only. Format column as date... and place this formula and copy down...
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This now works....
    Please Login or Register  to view this content.
    Last edited by sintek; 07-25-2017 at 07:08 AM.

  9. #9
    Registered User
    Join Date
    01-27-2017
    Location
    INDIA
    MS-Off Ver
    2016
    Posts
    90

    Re: copying data from one workbook to another workbook using date as citeria

    I have small doubt before testing

    Please Login or Register  to view this content.
    you have mentioned workbook name as "Logintime" where workbook name is "Data_base" and sheet name is "Logintime"

    or we can directly mention sheet name in the path

    Thanks..
    Last edited by narsing18; 07-25-2017 at 09:09 AM.

  10. #10
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,191

    Re: copying data from one workbook to another workbook using date as citeria

    This is your code from Post 1
    Please Login or Register  to view this content.
    I used that code for testing purposes...
    can't help you if you do not give the exact information...take some time to think about what you want to do and come back with the names of:
    1. the workbook that actually houses the code.....
    2. The workbook & worksheet that has to be opened, filtered and copied from
    3.The workbook & worksheet that has to be opened, renamed and copied to.......
    Edited:

    The above code refers to a file called Logintime.xlsm stored in Folder called Data_base
    Last edited by sintek; 07-25-2017 at 11:33 AM.

  11. #11
    Registered User
    Join Date
    01-27-2017
    Location
    INDIA
    MS-Off Ver
    2016
    Posts
    90

    Re: copying data from one workbook to another workbook using date as citeria

    Sorry its my mistake...as i attached two files i thought it might be clear..now i will explain step by step to avoid further confusion.
    1. i have two file TTM_Form.xlsm (source) and data_base.xlsm (destination)
    2. in TTM_Form( source ) i have sheet called "data sheet"
    3. in data_base (destination) i have sheet called "Logintime" in the same workbook i have sheet called "workform" where the dates have to been mentioned.


    now i want "data sheet" (TTM_Form, "source") to be copied to "logintime"(data_base, "destination") sheet

    4. and when ever it copies to destination sheet "logintime" it should clear the sheet if there is any data and then copy.

    hope you got it now

  12. #12
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,191

    Re: copying data from one workbook to another workbook using date as citeria

    Perfect, thank you for your explanation. I've got the code sorted except for one minor detail...
    Your original code renames the active sheet which is Logintime to the current date.... is this your requirement?

    Herewith code without renaming logintime...Just change your path...And remember to put in a helper column with date as suggested in Post8...As Per upload.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 07-26-2017 at 04:09 AM.

  13. #13
    Registered User
    Join Date
    01-27-2017
    Location
    INDIA
    MS-Off Ver
    2016
    Posts
    90

    Re: copying data from one workbook to another workbook using date as citeria

    Hi Sintek.....that's perfect ...its working as expected..thanks for your time and correcting my mistakes..

  14. #14
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,191

    Re: copying data from one workbook to another workbook using date as citeria

    Pleasure...Glad we got it sorted..thanks for rep +

  15. #15
    Registered User
    Join Date
    01-27-2017
    Location
    INDIA
    MS-Off Ver
    2016
    Posts
    90

    Re: copying data from one workbook to another workbook using date as citeria

    Hi Sintek...i have small problem with workbook "data_base" ..its not related to copying but if u can help me i will be very thankful...after copying the data to "Logintime" sheet the formula in column "D" should show
    Please Login or Register  to view this content.
    like this but its populating as
    Please Login or Register  to view this content.
    and not getting the proper results ...can you please let me know how to avoid it.
    Last edited by narsing18; 07-28-2017 at 09:16 AM. Reason: added in code brackets

  16. #16
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,191

    Re: copying data from one workbook to another workbook using date as citeria

    Try changing this.....Untested
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  17. #17
    Registered User
    Join Date
    01-27-2017
    Location
    INDIA
    MS-Off Ver
    2016
    Posts
    90

    Re: copying data from one workbook to another workbook using date as citeria

    Hi Sintek ...after change the vlues are showing as below

    Please Login or Register  to view this content.
    date and time values are changed to numerical values and difference is also not correct

+ 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. Copying data from one workbook to other based on date criteria
    By vinnb in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-12-2016, 06:30 AM
  2. Replies: 10
    Last Post: 05-13-2016, 08:31 AM
  3. Replies: 1
    Last Post: 05-13-2016, 05:01 AM
  4. copying data from a recently opened workbook to the workbook where the form is present
    By Sivaramakrishnan31 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2014, 12:03 PM
  5. [SOLVED] Copying data from a closed workbook into an open workbook ignoring excel filter?
    By reach78 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 09-17-2013, 12:31 AM
  6. Filtering in another workbook, copying filtered data and pasting in source workbook
    By saadtariq in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2012, 12:55 PM
  7. Replies: 1
    Last Post: 04-01-2006, 03:50 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