Object Required Error Accessing Userform Control

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
3,816
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I am receiving an "Object Required" error with with this line in red of my code ...

Rich (BB code):
With uf_base_01to_4.ListBox1
    For i = .ListCount - 1 To 0 Step -1
        If .List(i) = f_select Then
            .RemoveItem i
        End If
    Next i
End With

uf_base_1to_04 is my userform, and listbox1 is the listbox with the items slated for removal.

I don't understand what I need to do to resolve the error.
 
Last edited:

Some videos you may like

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

starl

Administrator
Joined
Aug 16, 2002
Messages
5,969
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
What a complicated naming convention. Are you sure you have the correct name?
In your code, you have uf_base_01to_4
in your text, you have uf_base_1to_04

They don't match
 
Last edited:

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
3,816
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Thank you for providing the second set of eyes ... it was indeed a typo. I had it wrong in both cases. 'uf_base_01to_04' is the actual.
 

starl

Administrator
Joined
Aug 16, 2002
Messages
5,969
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
Been there done that! Matter of fact, earlier I kept trying to test the following in my Immediate window:
Code:
Cells(17,15).Address

and kept getting an error. I finally gave up and continued coding when I realized what I missed. See it? Took me about 5 minutes *lol*
The frustration of a missing ? - to get a response in the Immediate Window - you need to precede code with a ?
Code:
? Cells(17,15).Address
 

Watch MrExcel Video

Forum statistics

Threads
1,123,525
Messages
5,602,175
Members
414,509
Latest member
Cdavis7078

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