Cell Formula to filter combobox data into cell

Patriot2879

Well-known Member
Joined
Feb 1, 2018
Messages
1,227
Office Version
  1. 2010
Platform
  1. Windows
Hi, good afternoon I would like to copy what is highlighted in my combobox which is in my userform1 i have tried the formula below which i have put in cell M1 but it doesnt pick up anything from the combobox can you help me please?

=filter!UserForm1 ("ComboBox1")
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
So you have a UDF(user-defined function) that extracts data from the Userform? is that?

If you need to just have the value of the combobox in cell A1, you could simply do
Code:
Range("A1").Value=Userform1.ComboBox1.value
 
Upvote 0
hi do i put that into the cell where i want the data found to go? Or do i put that into the combox1?
 
Last edited:
Upvote 0
hi do i put that into the cell where i want the data found to go? Or do i put that into the combox1?

It all depends on how your userform is set-up. If the cell you want to copy to is already active, you can have an OK button on the userform that when you click will copy the selected value to the cell
 
Upvote 0
Hello what I would like is in my sheet called 'filter' is to copy what is highlighted in my combobox1 in userform1. If you can advise please
 
Upvote 0
So you have a UDF(user-defined function) that extracts data from the Userform? is that?

If you need to just have the value of the combobox in cell A1, you could simply do
Code:
Range("A1").Value=Userform1.ComboBox1.value
Thats what i suggested here

You can have an OK button on the userform and place that line of code in there, so when you click the OK button, the selected value in the combobox is copied to cell A1
Code:
Worksheets("Filter").Range("A1").Value = Userform1.ComboBox1.Value
or
Code:
Activecell.Value=Userform1.ComboBox1.Value
if you want it to copy to the activecell
 
Last edited:
Upvote 0
Hi sorry I'm still new to this. Where do I put the activecell? I didt want another button but just to copy over to the cell automatically. Thanks for the help
 
Upvote 0
Double click the combobox on the userform to open the code behind

You can paste a code like this in there

Code:
Private Sub ComboBox1_Change()
    Worksheets("Filter").Range("A1").Value = Me.ComboBox1.Value
End Sub

Whenever the combobox changes, the value in A1 changes, so maybe if you are specific about what cells you want the value copied to, we can write specific codes for what you want
 
Upvote 0
Hi thanyou for your help this works great much appreciated for your time :)
 
Upvote 0

Forum statistics

Threads
1,214,951
Messages
6,122,449
Members
449,083
Latest member
Ava19

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