Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,570
- Office Version
- 365
- 2016
- Platform
- Windows
I am embarrassed to post this as this is such a basic concept ...
Although I have set my worksheet objects, they aren't being recognized at the end of my code. [Application-defined or object-defined error]. Perhaps I can't do this in userform code?
VBA Code:
Private Sub UserForm_Initialize()
Dim frm_service As Object
Dim ws_master As Worksheet
Dim ws_thold As Worksheet
mbevents = False
Set frm_service = frm_tservices
Set ws_master = Workbooks("task allocation.xlsm").Worksheets("Master")
Set ws_thold = Workbooks("task allocation.xlsm").Worksheets("thold")
With frm_services
Me.Width = 366
Me.Height = 288
Stop
Me.tb_permit = ws_master.Cells(srow, 3).Value
Me.tb_event = ws_master.Cells(srow, 5).Value
Stop
With Worksheets("thold") 'ws_thold
.Cells(1, 26) = "=VLOOKUP(""" & pnum & """,('D:\WSOP 2020\[permit_data.xlsx]Permit_Data'!$A3:$E2000),5,FALSE)"
End With
Me.tb_function = ws_thold.Cells(1, 26).Value
End With
mbevents = True
End Sub
Although I have set my worksheet objects, they aren't being recognized at the end of my code. [Application-defined or object-defined error]. Perhaps I can't do this in userform code?
Last edited by a moderator: