G
gwoodby
Any help would be Greatly Appreciated!!!!
userForm1 Has a listbox with a list of names, When the name is
Selected it needs to search 3 sheets, then Make The Sheet That The
name is on to be Active, and load the corresponding from specified
cells how would this is what i have come up with so far but its not
working :|
Private Function StrFind(StrList As String)
Dim SearchTxt As String
Dim rng As Range
Dim sh As Worksheet
With ThisWorkbook.ActiveSheet
If ListBox.Text = "" Then
GoTo ErrorHandler
End If
TextBox1.Text = LstBox.Text
SearchTxt = FrmSelection.LboxSelect.Text
Set sh = ActiveSheet
Set rng = sh.Cells.Find(What:=SearchTxt, After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:=False)
If Not rng Is Nothing Then
sh.Activate
' my code here
end if
End with
ErrorHandler:
MsgBox "Please Select One", vbOKOnly, "Error"
End Function
Seeing as how I am a novice Any Input would be Appreciated, and Any
Pointers as well.
thank you!
userForm1 Has a listbox with a list of names, When the name is
Selected it needs to search 3 sheets, then Make The Sheet That The
name is on to be Active, and load the corresponding from specified
cells how would this is what i have come up with so far but its not
working :|
Private Function StrFind(StrList As String)
Dim SearchTxt As String
Dim rng As Range
Dim sh As Worksheet
With ThisWorkbook.ActiveSheet
If ListBox.Text = "" Then
GoTo ErrorHandler
End If
TextBox1.Text = LstBox.Text
SearchTxt = FrmSelection.LboxSelect.Text
Set sh = ActiveSheet
Set rng = sh.Cells.Find(What:=SearchTxt, After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:=False)
If Not rng Is Nothing Then
sh.Activate
' my code here
end if
End with
ErrorHandler:
MsgBox "Please Select One", vbOKOnly, "Error"
End Function
Seeing as how I am a novice Any Input would be Appreciated, and Any
Pointers as well.
thank you!