+ Reply to Thread
Results 1 to 5 of 5

Search for dates and copy specific cells to another sheet

  1. #1
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Search for dates and copy specific cells to another sheet

    Hello everyone,

    I need your help please. I'm trying to copy and paste the result of dates search from the 'payment' worksheet to another worksheet. Below is the code I wrote but somehow I got the mismatch error on the highlighted lines below. I'm sure there is a better way of doing this but I thought this would just do what I'm aiming to fulfil.

    The from date will be always in this format 01/mm/yyyy and the to date will be the last day on the selected month for that year, to which the endDate will then be the to Date +1 day.

    Agent will choose the start date and end date from the userform.

    Your help is much appreciated. Thank you



    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by rakotonirinas; 11-07-2019 at 08:32 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,474

    Re: Search for dates and copy specific cells to another sheet

    Try this,

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Re: Search for dates and copy specific cells to another sheet

    Hi dave,
    Absolutely working, absolutely amazing. Thank you so much.
    Just a quick question. If I have to properly declare all variables, what would they be? that is, m,d, y , Edate and startdate. Can I declare all of them as date?
    Thank you.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,474

    Re: Search for dates and copy specific cells to another sheet

    month,day yr can all be integers. The actual dates can be dim'd as date

  5. #5
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Re: Search for dates and copy specific cells to another sheet

    Brilliant. 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: 2
    Last Post: 06-23-2018, 06:40 PM
  2. Replies: 16
    Last Post: 08-09-2017, 12:50 PM
  3. Replies: 13
    Last Post: 05-02-2016, 06:03 AM
  4. Need a Macro that search a specific word and copy line to another sheet
    By Akshaydivecha in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-21-2014, 10:15 AM
  5. [SOLVED] Search value in cells and copy adjacent value to specific cell
    By venkatakrishna in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-02-2014, 11:21 AM
  6. [SOLVED] Search values and copy to specific sheet & cells
    By keis386 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-19-2013, 12:24 PM
  7. Search specific column and then copy to new sheet
    By PowerZ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-25-2010, 10:04 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