combobox autofilter issues

nuc_n_futs

Board Regular
Joined
Dec 10, 2008
Messages
78
Hi,

I am trying to populate combobox2(cmbcity) with the visible rows of an autofilter from combobox1(cmbstate)

For the life of me, I cannot figure out why I have an error:


Private Sub cmbstate_Change()
Dim sState As String
Dim rcity As Range

sState = cmbstate.Value
Application.ScreenUpdating = False
Set rcity = Sheet3.Range("b3:b800")

Sheet3.Activate

Sheet3.Range("$a$2:$g$685").AutoFilter field:=1, _
Criteria1:=sState
Sheet1.Select
cmbcity.ListFillRange = "city"
With cmbcity
ListFillRange.SpecialCells (xlCellTypeVisible)
End With



Application.ScreenUpdating = True
End Sub

I am getting a run time error 424, Object Required on line:
ListFillRange.Specialcells (xlcelltypevisible)

Can someone tell me what i am doing wrong?

Thanks,

Nuc
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Should there be a period before ListFillRange.Specialcells (xlcelltypevisible)?

Try:
With cmbcity
.ListFillRange.SpecialCells (xlCellTypeVisible)
End With
 
Upvote 0

Forum statistics

Threads
1,224,598
Messages
6,179,822
Members
452,946
Latest member
JoseDavid

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
Back
Top