Missing another fundamental concept re: User Forms, getting error 424, Object Required

I_Batman

Board Regular
Joined
Oct 14, 2011
Messages
62
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:

Code:
.Cells(NewRow, 1).Value = CustomerNameComboxBox.Value
This sub immediately below contains the code that fails:

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
The sub, that actually works, and populates the userform in the first place is below:

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
 

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,271
Office Version
  1. 365
Platform
  1. Windows
You've misspelt the combobox name.

If you add Option Explicit and goto Debug>Compile VBA will show you where.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,428
Messages
5,624,740
Members
416,046
Latest member
Elliottj2121

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top