ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ComboBox and text Box (https://www.excelbanter.com/excel-programming/373966-combobox-text-box.html)

[email protected]

ComboBox and text Box
 

I have a combobox that has two values

Value 1 = Orange
Value 2 = Pink

If I choose Orange I want to get Cell B1 in the text box and if I
choose Pink I want to get cell B2 in the same text box. Only one choice
the user will have to pick. please help


Nigel

ComboBox and text Box
 
Private Sub ComboBox1_Change()
Select Case ComboBox1.ListIndex
Case Is = 0 'orange
TextBox1.Value = Sheets("Sheet1").Range("B1")
Case Is = 1 ' pink
TextBox1.Value = Sheets("Sheet1").Range("B2")
Case Else
TextBox1.Value = ""
End Select
End Sub

--
Cheers
Nigel



wrote in message
ps.com...

I have a combobox that has two values

Value 1 = Orange
Value 2 = Pink

If I choose Orange I want to get Cell B1 in the text box and if I
choose Pink I want to get cell B2 in the same text box. Only one choice
the user will have to pick. please help





All times are GMT +1. The time now is 05:25 PM.

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