Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a three part question.
First, I want to be able to assign a value in a cell, on only one of three worksheets, to a variable. Second, I want to be able to compare that value using a CASE statement. Finally, I want to be able to associate this macro to a command button that will run it. Thanks in advance, Al |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub CommandButton1_Click
vVal = Worksheets("Sheet1").Range("B9").Value Select Case vVal Case 1 Case 2 Case Else End Select End Sub Not sure of the significance of 1 of 3 worksheets. Place a commandbutton on your sheet. Double click on it while in design mode and you should get the declaration Private Sub CommandButton1_Click End Sub You can add code in this procedure. -- Regards, Tom Ogilvy "Al" wrote in message ... I have a three part question. First, I want to be able to assign a value in a cell, on only one of three worksheets, to a variable. Second, I want to be able to compare that value using a CASE statement. Finally, I want to be able to associate this macro to a command button that will run it. Thanks in advance, Al |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
can I make cell "yes" equal 1, "no" equal 0 | Excel Discussion (Misc queries) | |||
VBA check to see if variable value is odd but not equal to 1 | Excel Discussion (Misc queries) | |||
How to point to (select) a cell to the left from a cell where I enter the = equal sign? | Excel Discussion (Misc queries) | |||
Addition to Turn cell red if today is greater or equal to date in cell | New Users to Excel | |||
variable not equal to expression | Excel Programming |