Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming of alternative actions in VB macros
Need help. I want a macro to run two alternative actions (not cell entries in
the worksheet) under the condition that in an Excel cell the entry is 1 or 0. Can I write something like: if(cell=1, than jump to macro line 10, otherwise jump to macro line 20)? What would be the syntax? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming of alternative actions in VB macros
Hi
Sub test() Select Case Sheets(1).Range("A1").Value Case 0 MsgBox "Here's zero" MsgBox "Not much, that" Case 1 MsgBox "There's a one in there !" MsgBox "we won" Case Else MsgBox "Nonsense in A1" End Select End Sub HTH. Best wishes Harald "Matt" skrev i melding ... Need help. I want a macro to run two alternative actions (not cell entries in the worksheet) under the condition that in an Excel cell the entry is 1 or 0. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007-programming macros that apply to data validation | New Users to Excel | |||
Hep with Conditionals actions please. | Excel Worksheet Functions | |||
Request for Learning Macros and their Programming for Begginners | Excel Discussion (Misc queries) | |||
How to perform two actions ? | Excel Worksheet Functions | |||
Help Programming Macros | Excel Programming |