ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ComboBox question (https://www.excelbanter.com/excel-programming/410460-combobox-question.html)

Patrick C. Simonds

ComboBox question
 
I have a combo box which displays 2 columns. is there any way to have the
value in column 1 placed in rng(1, 43) and the value in column 2 placed in
rng(1, 42).

My current code (below) the value of column 1 where I want it, but I do not
know how to get the value in column 2 where I want if (if it is even
possible to do what I want).



Private Sub ComboBox1_Change()
'Work Code 1
Dim rng
Set rng = Cells(ActiveCell.Row, 1)
rng(1, 43).Value = ComboBox1.Text
End Sub


Gary Keramidas

ComboBox question
 
doesn't something like this work?

Range("c12") = Me.ComboBox1.Column(0)
Range("c13") = Me.ComboBox1.Column(1)


--


Gary


"Patrick C. Simonds" wrote in message
...
I have a combo box which displays 2 columns. is there any way to have the
value in column 1 placed in rng(1, 43) and the value in column 2 placed in
rng(1, 42).

My current code (below) the value of column 1 where I want it, but I do not
know how to get the value in column 2 where I want if (if it is even possible
to do what I want).



Private Sub ComboBox1_Change()
'Work Code 1
Dim rng
Set rng = Cells(ActiveCell.Row, 1)
rng(1, 43).Value = ComboBox1.Text
End Sub





All times are GMT +1. The time now is 12:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com