Hi,
I currently have the following code which populates a userform with data based on the what is held in a worksheet within the current workbook.
Is it possible to change the code below to get the data from a different (closed) workbook/sheet?
[vba]Private Sub ThisMonth()
Dim dtNow As Date
Dim dtToday As Long
dtNow = Now
dtToday = DatePart("m", dtNow)
With Me
Select Case dtToday
Case 1: .lbxResults.RowSource = ("Support!JanRota")
Case 2: .lbxResults.RowSource = ("Support!FebRota")
Case 3: .lbxResults.RowSource = ("Support!MarRota")
Case 4: .lbxResults.RowSource = ("Support!AprRota")
Case 5: .lbxResults.RowSource = ("Support!MayRota")
Case 6: .lbxResults.RowSource = ("Support!JunRota")
Case 7: .lbxResults.RowSource = ("Support!JulRota")
Case 8: .lbxResults.RowSource = ("Support!AugRota")
Case 9: .lbxResults.RowSource = ("Support!SepRota")
Case 10: .lbxResults.RowSource = ("Support!OctRota")
Case 11: .lbxResults.RowSource = ("Support!NovRota")
Case 12: .lbxResults.RowSource = ("Support!DecRota")
End Select
End With
End Sub[/vba]
Thanks,