View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Patrick C. Simonds Patrick C. Simonds is offline
external usenet poster
 
Posts: 343
Default Not getting hoped for result

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