I am failing at learning another basic concept.
The code at the very bottom of this post works, and populates my CustomerNameComboBox with data from the worksheet.
However, when I edit/add new data in the same box, and hit the Save Button I have on my userform, I get error 424, Object Required.
The error in question appears on this line:
This sub immediately below contains the code that fails:
The sub, that actually works, and populates the userform in the first place is below:
The code at the very bottom of this post works, and populates my CustomerNameComboBox with data from the worksheet.
However, when I edit/add new data in the same box, and hit the Save Button I have on my userform, I get error 424, Object Required.
The error in question appears on this line:
Code:
.Cells(NewRow, 1).Value = CustomerNameComboxBox.Value
Code:
Private Sub CustomerInformationSaveButton_Click()
'When the save button on the userform is clicked this subroutine will add a new row of data to the bottom of the Customers worksheet, regardless if it is duplicate information or not'
Dim WorkingSheet As Worksheet
Dim FinalRow As Integer
Dim NewRow As Integer
Set WorkingSheet = Worksheets("Customers")
With WorkingSheet
FinalRow = .Cells(.Rows.Count, 1).End(xlUp).Row
NewRow = FinalRow + 1
.Cells(NewRow, 1).Value = CustomerNameComboxBox.Value
End With
End Sub
Code:
Private Sub CustomerNameComboBox_Click()
'When a customer name is selected from the dropdown menu this subroutine will populate text boxes'
'with data found in other cells containing that customer's name'
Dim CustomerNameRowLocation As Range
Dim CustomerRng As Range
Dim JobRequestedRng As Range
Dim WorkingSheet As Worksheet
Dim FinalRow As Integer
Set WorkingSheet = Worksheets("Customers")
With WorkingSheet
FinalRow = .Cells(.Rows.Count, 1).End(xlUp).Row
Set CustomerRng = .Range("A2").Resize(FinalRow - 1)
With CustomerRng
Set CustomerNameRowLocation = .Find(CustomerNameComboBox.Value)
With CustomerNameRowLocation
StreetAddressTextBox = .Offset(0, 1)
CityTextBox = .Offset(0, 2)
PostalCodeTextBox = .Offset(0, 3)
PhoneTextBox = .Offset(0, 4)
DetailsTextBox = .Offset(0, 7)
End With
End With
End With
End Sub