Results 1 to 7 of 7

Match (2 criteria) then copy paste

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-01-2012
    Location
    rotterdam, holland
    MS-Off Ver
    Excel 2013
    Posts
    170

    Match (2 criteria) then copy paste

    I want to match my database with 2 criteria, in columns AB and AC with the range columns A and B.
    If they match, it should copy and paste the corresponding columns from my database to the range. It should copy and paste when match, like lets say AD6 in D10 and AE6 in E10.
    I want the other formulas in the columns A:F to be intact, I want it to just paste the times in the matching name and date.

    I made this up but its rubbish.
    Anyone a batter macro? Thanks a lot.


    test2 - Copy.xlsm

    Option Explicit
    Sub FindStr()
         
        Dim rFndCell As Range
        Dim strData As String
        Dim stFnd As String
        Dim fCol As Integer
        Dim sh As Worksheet
    
        Set sh = Sheets("TIMESPAN")
        stFnd = sh.Range("AB6").Value
         
        With sh
            Set rFndCell = .Range("A:B").Find(stFnd, LookIn:=xlValues)
            If Not rFndCell Is Nothing Then
                fCol = rFndCell.Column
                sh.Range("AB6:AE").Copy sh.Cells(6, fCol)
            End If
        End With
         
    End Sub
    Last edited by IKZOUHETNIETWETEN; 05-13-2013 at 04:53 PM.

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