LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Combobox Value

Hi!!

I´m having trouble with subtract the value of the current item in my
combobox, I´ve created an combobox with to items A and B in excel. Later I
need to reach the the choosen value. So how to i get the value that is
displayed in the combobox. Im using value now. But this gives me the offset
value doesnt change when I change comboitem.

Here is my code:


Sub testCombo()
Dim oWs As Worksheet
Dim oOLE As OLEObject
Dim combo As ComboBox
Set oWs = ActiveSheet
Dim cell As Range


'To set with a cell
With Range("F8")
Set oOLE =
ActiveSheet.OLEObjects.Add(ClassType:="Forms.combo box.1", _
Left:=.Left, Top:=.Top, Width:=.Width,
Height:=.Height)
.ShrinkToFit = False
.MergeCells = False
.WrapText = True

Set combo = oOLE.Object
combo.Font.Size = 8
combo.ForeColor = RGB(255, 255, 255)
combo.AddItem ("A")
combo.ForeColor = RGB(0, 0, 255)
combo.AddItem ("B")
combo.ListIndex = 0
combo.Placement = xlMoveAndSize
combo.PrintObject = True


End With

Set cell = Cells(13, 5)
MsgBox combo.Value

End Sub
...............................................
Can somebody plz help me, thx
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox Minitman[_4_] Excel Programming 3 October 26th 04 07:58 PM
Populating combobox from another combobox David Goodall Excel Programming 1 September 12th 04 03:42 PM
Combobox rua17 Excel Programming 3 July 29th 04 09:55 PM
ComboBox Avner Mediouni Excel Programming 1 September 4th 03 03:18 PM


All times are GMT +1. The time now is 08:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"