View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
shane shane is offline
external usenet poster
 
Posts: 72
Default Embedded Combobox (Form Control)

Sorry... that is an ActiveX control embedded on the sheet.

"Shane" wrote:

On a sheet I have an embedded from control that, upon clicking a
commandbutton, I want the value of the combobox copied to another sheet.
Currently, the code below has "Empty" as the value of the all of the
comboboxes (named "CBCell" even though the properties window shows the text
and value as my selection. What am I missing in the following code?

Sub Button120_Click()
Dim WS As Worksheet
Set WS = ThisWorkbook.Sheets("Q-Investment Rebalancing")
Sheets("Client Agenda").Visible = True
Sheets("Client Agenda").Range("CAOverallRange").Value = ""
With Sheets("Client Agenda")
.Range("CAopt1").Value = WS.Range("c18").Value
.Range("CAopt2").Value = WS.Range("c19").Value
.Range("CAopt3").Value = CBCell20
.Range("CAopt4").Value = CBCell21
.Range("CAopt5").Value = CBCell22
.Range("CAopt6").Value = CBCell23
.Range("CAopt7").Value = CBCell24
.Range("CAopt8").Value = CBCell25
.Range("CAopt9").Value = CBCell26
.Range("CAopt10").Value = CBCell27
.Range("CAopt11").Value = CBCell28
.Range("CAopt12").Value = CBCell29
.Range("CAopt13").Value = WS.Range("C30").Value
End With
Sheets("Q-Investment Rebalancing").Select
End Sub