ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheets (https://www.excelbanter.com/excel-programming/349795-worksheets.html)

Paul W Smith[_4_]

Worksheets
 
I am looking to populate a list box on a userform.

I have set it's Row Source to a specific range on a worksheet.

I am trying to make the Row Source Range Dynamic based on two parameters.

I have nine identically formatted workbooks. The first Parameter and I
managed this part, refers to a location (by me using offsets). The second
parameter and is a number needs to refer to which of the nine worksheets to
use.

Can anyone offer any ideas?



Ron de Bruin

Worksheets
 
Hi

You can use the sheetindex or if your sheet names are
Sheet1,Sheet2..... the second example

Sub test()
Dim ShNumber
ShNumber = 1
MsgBox Sheets(ShNumber).Range("A1").Value
End Sub

Sub test2()
Dim ShNumber
ShNumber = 1
MsgBox Sheets("Sheet" & ShNumber).Range("A1").Value
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Paul W Smith" wrote in message ...
I am looking to populate a list box on a userform.

I have set it's Row Source to a specific range on a worksheet.

I am trying to make the Row Source Range Dynamic based on two parameters.

I have nine identically formatted workbooks. The first Parameter and I managed this part, refers to a location (by me using
offsets). The second parameter and is a number needs to refer to which of the nine worksheets to use.

Can anyone offer any ideas?





All times are GMT +1. The time now is 07:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com