Search in combobox1 VBA in a form

titivaler

New Member
Joined
May 1, 2018
Messages
3
I would like to populate range "ar1", when I write in the form for a combobox1, range "ar1" should be populated immediately, I'm using Range ("ar1") = ComboBox1.Value, however, It only write first letter,

I also have tried to put "ar1" in controlsource from combobox properties, but when I write In the combobox1, I must close the form to see what I have written in "ar1" worksheet in excel.

Is ther any way to write into the combobox1 and immediately update the range "ar1",

Code:


Code:
Private Sub ComboBox1_Change ()
Range ("ar1") = ComboBox1.Value
ComboBox1.RowSource = "as3: as" & 3 + Range ("as2"). Value 'charge the combo items that depend on ar1 range
ComboBox1.DropDown '
End SubPrivate Sub ComboBox1_Change ()
****** id="cke_pastebin" style="position: absolute; top: 10px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">Private Sub ComboBox1_Change ()
Range ("ar1") = ComboBox1.Value
ComboBox1.RowSource = "as3: as" & 3 + Range ("as2"). Value 'charge the combo items that depend on ar1
ComboBox1.DropDown '
End SubPrivate Sub ComboBox1_Change ()</body>
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
can you please advise what is the code for _afterupdate? can you please let me know an example for trying it?
 
Upvote 0
_Change is after each character, you want to use _AfterUpdate

I re-read your post. A combobox is a selection, not a place you input ("write in"). But further, I don't understand the issue. I thought you simply wanted range("ar1") to equal combobox1.value
Also, this line doesn't seem like it would work:
Code:
ComboBox1.RowSource = "as3: as" & 3 + Range ("as2"). Value 'charge the combo items that depend on ar1 range
As RowSource typically is a range or named range
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,721
Members
449,093
Latest member
Mnur

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