Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This code is using the current (active) Worksheet to provide the list data
not Friday Workshifts. Can any one tell me what I have missed? Private Sub UserForm_Initialize() With Worksheets("Friday Workshifts") ListBox1.RowSource = "$A$2:$R$200" End With End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just include the sheet name that the rowsource is on as in the example:
Private Sub UserForm_Initialize() With Worksheets("Friday Workshifts") ListBox1.RowSource = "'SheetName'!$A$2:$R$200" End With End Sub Requires the single quotes and the exclamation mark. "Patrick C. Simonds" wrote: This code is using the current (active) Worksheet to provide the list data not Friday Workshifts. Can any one tell me what I have missed? Private Sub UserForm_Initialize() With Worksheets("Friday Workshifts") ListBox1.RowSource = "$A$2:$R$200" End With End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks
"JLGWhiz" wrote in message ... Just include the sheet name that the rowsource is on as in the example: Private Sub UserForm_Initialize() With Worksheets("Friday Workshifts") ListBox1.RowSource = "'SheetName'!$A$2:$R$200" End With End Sub Requires the single quotes and the exclamation mark. "Patrick C. Simonds" wrote: This code is using the current (active) Worksheet to provide the list data not Friday Workshifts. Can any one tell me what I have missed? Private Sub UserForm_Initialize() With Worksheets("Friday Workshifts") ListBox1.RowSource = "$A$2:$R$200" End With End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'd use:
With Worksheets("Friday Workshifts") me.ListBox1.RowSource = .range("$A$2:$R$200").address(external:=true) End With And not have to ever worry about the syntax. "Patrick C. Simonds" wrote: This code is using the current (active) Worksheet to provide the list data not Friday Workshifts. Can any one tell me what I have missed? Private Sub UserForm_Initialize() With Worksheets("Friday Workshifts") ListBox1.RowSource = "$A$2:$R$200" End With End Sub -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
RANK not resulting as hoped | Excel Discussion (Misc queries) | |||
vlookup shows result one cell above the expected result | Excel Worksheet Functions | |||
excel result return wrong calcuation result | Excel Worksheet Functions | |||
Advanced formula - Return result & Show Cell Reference of result | Excel Worksheet Functions | |||
vlookup based on random result returns incorrect result | Excel Worksheet Functions |