Results 1 to 3 of 3

Vlookup in macro

Threaded View

Jymoz Vlookup in macro 02-10-2007, 11:53 AM
Leith Ross Hello Jymoz, This code... 02-10-2007, 03:44 PM
Jymoz Thanks Leith Ross, i really... 02-11-2007, 05:48 AM
  1. #1
    Registered User
    Join Date
    11-30-2006
    Posts
    57

    Vlookup in macro

    I waned a macro to bring up multiple values when i enter in a value. I was given this code:

     
    Dim sFind As String
    
        If Target.Column > 1 Then Exit Sub
        If Target.Cells.Count > 1 Then Exit Sub
        sFind = Target.Value
        If Not Intersect(Target, Sheet2.Range("A1:A1000")) Is Nothing Then
            Target.Offset(0, 1).Value = WorksheetFunction.VLookup(sFind, Sheet1.Range("Data"), 2, False)
            Target.Offset(0, 2).Value = WorksheetFunction.VLookup(sFind, Sheet1.Range("Data"), 3, False)
            Target.Offset(0, 3).Value = WorksheetFunction.VLookup(sFind, Sheet1.Range("Data"), 4, False)
        End If
    End Sub
    The problem is i dont know how it works and so i cant adapt it to my system. Can someone explain it to me
    Last edited by VBA Noob; 02-10-2007 at 12:01 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