+ Reply to Thread
Results 1 to 4 of 4

Copy/Paste based on Date Range

  1. #1
    Registered User
    Join Date
    06-15-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2003
    Posts
    23

    Copy/Paste based on Date Range

    I would like to create a macro that will copy rows of data from one worksheet (Sheet1) and paste them in another worksheet (Sheet2), based on a date range. The column on Sheet1 containing the data's date will be Column D.

    The date range will be located on a third worksheet (Sheet 3) in cells L2 (Begin Date) and L3 (End Date).

    Any help would be great.

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Copy/Paste based on Date Range

    Will the dates be sorted?

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Copy/Paste based on Date Range

    Hello there,

    Below is a code that should work for you, assuming sheet1 is the first tab/worksheet in the workbook, sheet2 is the second tab/worksheet in the workbook, and sheet3 is the third tab/worksheet in the workbook.

    Please Login or Register  to view this content.
    To insert the code

    1.Press Alt+F8 on your keyboard
    2.Clear the macro name box and type LocateCells in the blank box provided
    3.Select the Create option
    4.In between the Sub LocateCells() and End Sub copy and paste the code provided above
    5.Exit out of the Visual Basic Window
    6.Press Alt+F8 again and this time select the LocateCells macro
    7.Select Run

  4. #4
    Registered User
    Join Date
    06-15-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Copy/Paste based on Date Range

    The code above is nearly correct. It only copies the information from the cell in column D, I would like the whole row to be copied and then pasted to Sheet2.

    ---------- Post added at 09:24 AM ---------- Previous post was at 09:23 AM ----------

    And no the dates will not be sorted, they will be in a random order.

+ 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