|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
VBA question in Excel
I have a combobox, with 4 options, which is linked to C2 in excel and what I what to do is when onchange i want D2 updated as well.
So if combobox =1 then D2 = 0 and so on. Can anyone please let me know how to do this. Cheers I'm no a VBA person. |
|
#2
|
|||
|
|||
|
I'm not sure i understand your question correctly but i think you mean you want to put the selected values in more than 1 cell and the property linkedcel can only contain 1 cell reference.
In that case i would just put the formula in d1 to "=c1" but i guess for some or other reason you don't wanna do that. if you wanna put the selection to more than one cell in code you would do this as follows. Go to the visual basic editor by double-clicking the combobox in design mode. then put this code in the section for the combobox : Private Sub ComboBox1_Change() ActiveSheet.Range("c2").Value = ComboBox1.Value ActiveSheet.Range("d2").Value = ComboBox1.Value End Sub if you click the button then (first turn of design mode again, it's that blue triangle form button) it should work. Hope this solves your problem Kind regards Marc |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > VBA question in Excel |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|