Not getting the result I was hoping for

  • Thread starter Thread starter Patrick C. Simonds
  • Start date Start date
P

Patrick C. Simonds

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
 
Private Sub UserForm_Initialize()
Dim ws As Worksheet
Dim curCell As Variant
Dim r As Long
Set ws = Worksheets("Friday Workshifts")
ListBox1.Clear
For r = 2 To 200
Set curCell = ws.Range("A" & r)
If Not IsEmpty(curCell) Then
ListBox1.AddItem (curCell)
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top