How to call worksheet name?

cheer

Registered User.
Local time
Today, 19:48
Joined
Oct 30, 2009
Messages
222
Dim xl As Excel.Application
Dim xlWrkSht As Excel.Worksheet
Dim xlWrkBk As Excel.Workbook

Set xl = CreateObject("Excel.Application")
Set xlWrkBk = GetObject(strBOMExcelFilePath)
Set xlWrkSht = xlWrkBk.Worksheets(1)

I have this piece code here http://www.access-programmers.co.uk/forums/showthread.php?t=212746

Can anyone suggest how to call rewrite the code for the highlight in red color so that the above function can call different worksheet. Currently the code only manage to call the FIRST worksheet
 
Let's say you have a combo box that has the list of worksheets in it (hmm, sound familiar :D ). You could use

Set xlWrkSht = xlWrkBk.Worksheets(Me.ComboBoxNameHere)
 
Thanks for the info above. How to load worksheet name into combo box?
 

Users who are viewing this thread

Back
Top Bottom