Accessing data from combo box from VBA

G

Guest

I set up VBA code to acccess data entered into a combo box on an Excel
spreadsheet. The code in the last line is not working and I can't seem to
locate the proper command in the Help:

Dim cmbComboBox1 As ComboBox
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Registration")
Set cmbComboBox1 = ws.ComboBox1
 
G

Guest

wrote:

i.e.

Dim cmbComboBox1 As Shape
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Registration")
Set cmbComboBox1 = ws.Shapes.Item("ComboBox1")
cmbComboBox1.OLEFormat.Object.ListFillRange = Range("A1:A10").Address
MsgBox "TopLeftCell" & cmbComboBox1.TopLeftCell.Address
..........
 

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

Top