+ Reply to Thread
Results 1 to 2 of 2

Find cell and paste based on multiple (two) criteria

  1. #1
    Registered User
    Join Date
    05-14-2012
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    2

    Find cell and paste based on multiple (two) criteria

    Hi there,

    I'm trying to code a macro to copy a range of values on Sheet 1 (E11:E21) and find a location to paste them to on DataD based on two criteria; 1. the date on Sheet 1 (H3) and the name on Sheet 1 (C5). It will first have to search row 2 of Data D for a matching name, then search column 1 of Data D for the matching date (in this case Aug-10).

    I got this so far which does the first part and pastes at a fixed offset but now I'm stumped:


    Sub StatsTrans()


    Application.ScreenUpdating = False

    msg1 = MsgBox("Current crash blood stats will be transfered to InputA. Are You Sure?", vbYesNo)
    If msg1 = vbNo Then Exit Sub

    Dim FoundName As Range
    Set FoundName = Worksheets("DataD").Rows("2").Find(Worksheets("Sheet1").Range("C5").Value, LookIn:=xlValues, LookAt:=xlWhole)

    If Not FoundName Is Nothing Then
    Worksheets("Sheet1").Range("E11,E13,E14,E16,E17,E19,E21").Copy
    FoundName.Offset(0, 1).PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=True, Transpose:=True

    End If
    Range("A1").Select
    Application.CutCopyMode = False

    MsgBox "The data has been successfully copied."

    Application.ScreenUpdating = True
    End Sub


    Any help!?

    Cheers


    Output Workbook.xls

  2. #2
    Forum Contributor dogberry's Avatar
    Join Date
    07-15-2012
    Location
    Wales, UK
    MS-Off Ver
    Excel 2010
    Posts
    624

    Re: Find cell and paste based on multiple (two) criteria

    http://www.excelforum.com/excel-prog...-criteria.html

    Duplicate post with above

    Chris
    Click my star if I helped Thanks

+ 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