I make a simple UserForm and I want a searching in a excel column any text that I typed in a textbox.
Code for cmdbutton.
Any suggestions ??
I make a simple UserForm and I want a searching in a excel column any text that I typed in a textbox.
Code for cmdbutton.
Any suggestions ??
![]()
Option Explicit Sub sFindCell() ' this routine looks for whatever is in cell E4 in column H Dim rStart As Range: Set rStart = Range("H1") Dim rSearch As Range: Set rSearch = Range("E4") Dim rFind As Range ' for testing rSearch = "x" Range("H6:H14") = _ Application.WorksheetFunction.Transpose( _ Array("a", "b", "c", "d", "e", "f", "x", "y", "z")) On Error Resume Next Set rFind = _ rStart.EntireColumn.Find( _ What:=rSearch, _ After:=rStart, _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False, _ SearchFormat:=False) MsgBox rFind.Address On Error GoTo 0 End Sub
Change the code to use the ComboBox value.
Regards, TMS
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks