Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have this code which checks the value in cell A1, if it is not equal to a certain value then run the Banker macro If it is the show msg box If Range("A1").Value = 15 Or Range("A1").Value = 12 Or Range("A1").Value = 9 Or Range("A1").Value = 6 Or Range("A1").Value = 3 Or Range("A1").Value = 0 And Range("ab1").Value = "" Then MsgBox "Banker!", vbExclamation, "test" Banker Else If IsNumeric(Range("B9")) And Range("B9") 0.5 Or Range("B9").Value = "1p" Or Range("B9").Value = "10p" Or Range("B9").Value = "50p" Then MsgBox "Box already picked..chose another !", vbExclamation, "test" what I want added to the above is a further check to see if cell AB1 is populated with 1 if it is then run macro Banker2 if it isn't run Banker hope this makes sense |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Anthony,
I changed your code around to use some select statements instead of all of those IF statements with OR. I am not sure how you want to test Range("AB1"). I'm assumed that you're only checking if it is 1 and ignoring all of the other checks. I hope this helps. With Range("B9") Select Case Range("ab1").Value Case "" 'If Range("ab1").Value = "" Then Select Case Range("A1").Value Case 0, 3, 6, 9, 12, 15 MsgBox "Banker!", vbExclamation, "test" Banker End Select ElseIf (IsNumeric(.Value) And .Value 0.5) Or .Value = "1p" Or .Value = "10p" Or .Value = "50p" Then MsgBox "Box already picked..chose another !", vbExclamation, "test" ElseIf Range("ab1").Value = 1 Then Banker2 End Select On Mar 13, 11:26 am, Anthony wrote: Hi, I have this code which checks the value in cell A1, if it is not equal to a certain value then run the Banker macro If it is the show msg box If Range("A1").Value = 15 Or Range("A1").Value = 12 Or Range("A1").Value = 9 Or Range("A1").Value = 6 Or Range("A1").Value = 3 Or Range("A1").Value = 0 And Range("ab1").Value = "" Then MsgBox "Banker!", vbExclamation, "test" Banker Else If IsNumeric(Range("B9")) And Range("B9") 0.5 Or Range("B9").Value = "1p" Or Range("B9").Value = "10p" Or Range("B9").Value = "50p" Then MsgBox "Box already picked..chose another !", vbExclamation, "test" what I want added to the above is a further check to see if cell AB1 is populated with 1 if it is then run macro Banker2 if it isn't run Banker hope this makes sense |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. | Excel Programming | |||
Adding a Check Mark commant to the Menu | Excel Programming | |||
Adding Check Boxes | Excel Discussion (Misc queries) | |||
help to speed up adding check box | Excel Programming | |||
help to speed up adding check box | Excel Programming |