+ Reply to Thread
Results 1 to 2 of 2

Select Range found by Vlookup

  1. #1
    JG Scott
    Guest

    Select Range found by Vlookup

    I have a vlookup formula in a spreadsheet that returns a range name,
    either "Top" or "Bottom". (These are defined ranges in the
    spreadsheet.) I would like to write VBA to select the range returned
    by this vlookup.

    Thank you.


  2. #2
    Chip Pearson
    Guest

    Re: Select Range found by Vlookup

    Try something along the lines of


    Dim S As Variant
    On Error Resume Next
    S = Application.VLookup(Range("A1"), Range("B1:C2"), 2, False)
    If IsError(S) = False Then
    Range(S).Select
    Else
    ' not found
    End If



    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com

    "JG Scott" <[email protected]> wrote in message
    news:[email protected]...
    >I have a vlookup formula in a spreadsheet that returns a range
    >name,
    > either "Top" or "Bottom". (These are defined ranges in the
    > spreadsheet.) I would like to write VBA to select the range
    > returned
    > by this vlookup.
    >
    > Thank you.
    >




+ 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