Good Evening,
I am using the VB below to load a userform that has stats on for an ongoing project that is being run at work.
The only thing is i dont understand the "Object Required" error.
As far as i can tell i only have 1 if statement that is closed with an end if then an End Sub at the end.
All help appreciated
Thanks
Gavin
I am using the VB below to load a userform that has stats on for an ongoing project that is being run at work.
The only thing is i dont understand the "Object Required" error.
As far as i can tell i only have 1 if statement that is closed with an end if then an End Sub at the end.
All help appreciated
Thanks
Gavin
Code:
Private Sub cmdsubmit_Click()
'Open file
Workbooks.Open Filename:="C:\Users\MAZZA\Documents\Gavin\Car Park\FYVData.xls" 'Home
Dim myBook As Workbook
On Error Resume Next
Set myBook = Application.Workbooks("FYVData.xls")
On Error GoTo 0
'If Laura Haynes - Call Centre Enquiry
Dim ws As Worksheet
Set ws = Worksheets("Breakdown Stats")
If Outstanding.ComboBox1 = "Laura Haynes" Then
Pword = InputBox("Please enter password")
If Pword = "ticket" Then
ActiveWorkbook.Sheets("Breakdown Stats").Activate
Else
MsgBox "Please contact your administrator for a password"
Workbooks("FYVData.xls").Close True
Exit Sub
End If
'OverviewL name of Form to load
OverviewL.Show
OverviewL.TextBox1.Value = ws.Range("C3").Value 'Abdul - Created
OverviewL.TextBox18.Value = ws.Range("D3").Value 'Abdul - Closed
OverviewL.TextBox19.Value = ws.Range("E3").Value 'Abdul - o/s
OverviewL.TextBox7.Value = ws.Range("c4").Value 'Christopher - C
OverviewL.TextBox17.Value = ws.Range("D4").Value 'Christopher - W
OverviewL.TextBox27.Value = ws.Range("E4").Value 'Christopher - O
End If
End Sub