ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ComboBox and if (https://www.excelbanter.com/excel-programming/374183-combobox-if.html)

[email protected]

ComboBox and if
 

How can i write a code for a ComboBox with two values Yes and No, when
I choose Yes I get Cell A1 and when I choose No I get 0.000?


Alok

ComboBox and if
 
Hi
I am slightly modifying the code from an earlier reply to your question. It
is not clear what you mean by 'get' but instead I will just use the Message
box to display.

Private Sub ComboBox1_Click()
Select Case ComboBox1
Case "Yes"
Msgbox Sheet1.Cells(1,1).value
Case "No"
Msgbox "0.000"
End Select
End Sub


" wrote:


How can i write a code for a ComboBox with two values Yes and No, when
I choose Yes I get Cell A1 and when I choose No I get 0.000?




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

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