LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default listbox selection to load to new form

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!

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to load a listbox in a userform? Martin Excel Discussion (Misc queries) 3 July 25th 07 03:16 PM
Listbox selection creates form Jennifer Excel Programming 6 March 9th 06 07:50 AM
Which User Form Listbox selection just checked? Don Wiss Excel Programming 3 October 27th 05 01:52 AM
Load data into a listbox Jennifer Excel Programming 1 June 26th 05 12:57 PM
Listbox initialized on workbook load Kandi Excel Programming 5 December 21st 04 05:19 PM


All times are GMT +1. The time now is 06:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"