Consulting

Results 1 to 4 of 4

Thread: excel vba search text in range and retrieve results in a textbox

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    excel vba search text in range and retrieve results in a textbox

    This macros is working, but I want to display results from a range D2:82 in text box without automatically redirection user to the located text. When it comes to VBA, I am a very basic user.I realize I may be asking a question already asked and answered in a different thread so I apologize about that. Help me please change my macros?
    Sub Button 1_Click()
    
    Res = InputBox("Who are you looking for?")    
    Set Rng = Worksheets("Level2").Range("B2:B82")'<<  The Sheet Name and Range to Search
    
    With Rng    
        Set MyChoice =.Find(What:=Res)
    
        IfNot MyChoice IsNothingThen    
            Application.Goto MyChoice    
        Else:GoTo ExitMyChoice
    
        EndIf
    
    EndWith    
    ExitSub
    
    ExitMyChoice:    
    MsgBox "Could Not Find "& Res
    
    EndSub
    Last edited by SamT; 09-13-2016 at 11:35 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •