combobox

  • Thread starter Thread starter T Saravana
  • Start date Start date
T

T Saravana

Hi

I have inserted combobox in the worksheet and when i click
on combobox i should get the clicked value to a variable.
can anyone of you help me.

thanks in advance.
 
1) If you used the "Forms" combo, then assign it to a
macro and make sure that there is a Cell Link.
Add to the sheet an index formula that returns the value
pointed at by this link and name range that cell
Your code should then get the value of that cell

2) If you're using the ActiveX Combo Box then simple code
the combo's change event...
Option Explicit



Private Sub ComboBox1_Change()
Dim sComboVal As String
sComboVal = ComboBox1.Value
Call MyProcess(sComboVal)
End Sub


In this example I get the combos value and pass it to my
handling procedure (MyProcess)

In stead of this, the event handler could call the
procedure and have the procedure get the value
' worksheet code page
Private Sub ComboBox1_Change()
MyComboHandler
End Sub

' module sheet
Public Sub MyComboHandler()
Dim sValue As String
sValue = Sheet2.ComboBox1.Value
End Sub


Regards
Patrick Molloy
Microsoft Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top