+ Reply to Thread
Results 1 to 6 of 6

Excel Command for analyzing dates and transferring data

Hybrid View

  1. #1
    Registered User
    Join Date
    06-13-2013
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    3

    Excel Command for analyzing dates and transferring data

    Im looking for a command to analyze a date in columns 1 and 2, and if the date in column 1 is greater than the date in column two, copy the row a specific set of cells in that row and paste into another sheet. Is this possible, and where do I paste the command?

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Excel Command for analyzing dates and transferring data

    yes possible

    please attach a sample workbook. Make sure the data make clear what is needed. Include BEFORE and AFTER sheets in the workbook if needed to show the results you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    06-13-2013
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Excel Command for analyzing dates and transferring data

    (See file attached)

    Im looking for a function which will analyze the dates in columns "P" and "Q" (rows 9-1314), and if the date in column "P" is greater than the date in column "Q", copy the information in columns C, D, E, F, G, and H (in that respective row) and paste it into sheet 2.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Excel Command for analyzing dates and transferring data

    If you change the name of sheet2 you will need to change it in the macro as well

    Sub CopyRow()
    '
    Dim cRow, lRow As Integer
    
        cRow = 9
        lRow = Sheets("Sheet2").Range("A65536").End(xlUp).Row + 1
    
        For cRow = 9 To 1314
        
            If Range("P" & cRow).Value > Range("Q" & cRow).Value Then
                Worksheets("Owner Review").Range("C" & cRow, "H" & cRow).Copy _
                    Destination:=Worksheets("sheet2").Cells(lRow, 1)
                lRow = lRow + 1
            End If
            
        Next
    
    End Sub
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-13-2013
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Excel Command for analyzing dates and transferring data

    Thanks that worked perfectly

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Excel Command for analyzing dates and transferring data

    Glad to help

+ 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