D
Dunmarie
I have a Excel Workbook with a couple of sheets. I would like to call a sheet
depending on a variable selected by the user.
My current code is as follows:
Dim xlw As Excel.Workbook
Dim xls As Excel.Worksheet
Dim xla As Excel.Application
Set xlw = GetObject("G:\Stock Take\Stock Month-End.xls")
Set xls = xlw.ActiveSheet
Set xla = xlw.Parent
[Text44] = xls.Cells(10, 2)
[Text54] = xls.Cells(10, 3)
[Text63] = xls.Cells(10, 4)
[Text201] = xls.Cells(10, 5)
[Text212] = xls.Cells(10, 7)
[Text90] = xls.Cells(10, 8)
I did not include the code for selecting the sheet depended on the var.
Any help will be appreciated.
Thanks.
depending on a variable selected by the user.
My current code is as follows:
Dim xlw As Excel.Workbook
Dim xls As Excel.Worksheet
Dim xla As Excel.Application
Set xlw = GetObject("G:\Stock Take\Stock Month-End.xls")
Set xls = xlw.ActiveSheet
Set xla = xlw.Parent
[Text44] = xls.Cells(10, 2)
[Text54] = xls.Cells(10, 3)
[Text63] = xls.Cells(10, 4)
[Text201] = xls.Cells(10, 5)
[Text212] = xls.Cells(10, 7)
[Text90] = xls.Cells(10, 8)
I did not include the code for selecting the sheet depended on the var.
Any help will be appreciated.
Thanks.