+ Reply to Thread
Results 1 to 3 of 3

using MATCH function in VBS problem

  1. #1
    Registered User
    Join Date
    06-15-2012
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    2

    using MATCH function in VBS problem

    what I have is a list of names on sheet one and want them to click on their name and then a search button that directs them to their name on sheet 2.

    right now I have it working with the cell to the right of their name I have =MATCH(A1,Sheet2!A:A,0) this returns a value of 6
    if they click on the cell and then click the search button I have it coded as follows (FYI the Data on sheet2 cannot be sorted so this my work around)


    Dim celladdy As String
    celladdy = ActiveCell.Value
    Sheets("Sheet2").Select
    Cells(celladdy, 1).Select

    so this works however it is difficult explaining to people to click on the cell to the right of the name and then the search button so I tried recoding(they start by click on the cell with a name)

    Dim celladdy As String
    celladdy = MATCH(Active.Cell.Value,Sheet2!A:A,0)
    Sheets(Sheet2").Select
    Cells(celladdy, 1).Select

    this returns a compile error. please advise

  2. #2
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,615

    Re: using MATCH function in VBS problem

    Pl try this code:


    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-15-2012
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: using MATCH function in VBS problem

    Thanks you kindly. works like a charm!

+ 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