Combo box change

vmjan02

Well-known Member
Joined
Aug 15, 2012
Messages
1,134
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
Private Sub ComboBox1_Change()
ActiveSheet.AutoFilterMode = False
ActiveSheet.Range("c3:aa3").Select
Selection.AutoFilter
Range("C3").AutoFilter Field:=1, Criteria1:=Sheets("sheet3").Range("d3").Value
ActiveSheet.Range.Offset(0, 24).Select
End Sub

above code don't work as I am trying to apply a autofilter and select the row with respect to the selection in combobox.

but no help.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Try...
Code:
Private Sub ComboBox1_Change()    
    ActiveSheet.AutoFilterMode = False
    ActiveSheet.Range("c3:aa3").Select
    Selection.AutoFilter
    [COLOR=#ff0000]Selection.AutoFilter[/COLOR] Field:=1, Criteria1:=Sheets("sheet3").Range("d3").Value
End Sub
and your last line will fail
Code:
ActiveSheet.Range.Offset(0, 24).Select
needs to ressemble this
Code:
ActiveSheet.Range[COLOR=#ff0000]("A1")[/COLOR].Offset(0, 24).Select
[/CODE]
 
Upvote 0
Did tried this code::-


Sub auto()


ActiveSheet.AutoFilterMode = False
ActiveSheet.Range("c3:aa3").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=Sheets("sheet3").Range("d3").Value


ActiveSheet.Range("c5").Offset(0, 24).Select
End Sub




Private Sub ComboBox1_Change()
UserForm1.Hide




Sheets("sheet3").Range("d3").Value = Me.ComboBox1.Value


Me.TextBox1.Value = Sheets("sheet3").Range("e3").Value ' Date
Me.TextBox2.Value = Sheets("sheet3").Range("f3").Value ' Ref Number
Me.TextBox3.Value = Sheets("sheet3").Range("g3").Value ' Description
Me.TextBox4.Value = Sheets("sheet3").Range("h3").Value ' Escalation by
Me.TextBox5.Value = Sheets("sheet3").Range("I3").Value ' Owner
Me.ComboBox2.Value = Sheets("sheet3").Range("Ab3").Value ' Status
Me.TextBox7.Value = Sheets("sheet3").Range("AA3").Value ' Ageing
Me.TextBox8.Value = Sheets("sheet3").Range("z3").Value ' Days
Me.TextBox9.Value = Sheets("sheet3").Range("d3").Value ' Esc ID


Me.TextBox10.Value = Sheets("sheet3").Range("Ac3").Value ' Update1
Me.TextBox11.Value = Sheets("sheet3").Range("Ad3").Value ' Update2
Me.TextBox12.Value = Sheets("sheet3").Range("Ae3").Value ' Update3




Call auto


End Sub




this entire code is not working. can you look into the same.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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