Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
What is wrong with this code?
Sub Macro1() Sheets("Sheet1").Select If Range("H20").Select = "FALSE" Then MsgBox "NOT CHECKED" Else MsgBox "CHECKED" End If End Sub H20 contains the result of a checkbox of either a False or True. Seem im always getting the Checked response which means im obviously no getting the result form the sheet correctly. Thanks again, Ke -- sungen9 ----------------------------------------------------------------------- sungen99's Profile: http://www.excelforum.com/member.php...nfo&userid=914 View this thread: http://www.excelforum.com/showthread.php?threadid=47551 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
What is wrong with this code?
Yep. That works. Thanks -- sungen99 ------------------------------------------------------------------------ sungen99's Profile: http://www.excelforum.com/member.php...fo&userid=9144 View this thread: http://www.excelforum.com/showthread...hreadid=475516 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
What is wrong with this code?
or this, no need to select anything:
Sub Macro1() If Sheets("Sheet1").Range("H20").Text = "FALSE" Then MsgBox "NOT CHECKED" Else MsgBox "CHECKED" End If End Sub -- Gary "sungen99" wrote in message ... Sub Macro1() Sheets("Sheet1").Select If Range("H20").Select = "FALSE" Then MsgBox "NOT CHECKED" Else MsgBox "CHECKED" End If End Sub H20 contains the result of a checkbox of either a False or True. Seems im always getting the Checked response which means im obviously not getting the result form the sheet correctly. Thanks again, Ken -- sungen99 ------------------------------------------------------------------------ sungen99's Profile: http://www.excelforum.com/member.php...fo&userid=9144 View this thread: http://www.excelforum.com/showthread...hreadid=475516 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
What is wrong with this code?
Even simpler. Since the data source of a checkbox is a boolean value this will work. Sub Macro1() If Sheets("Sheet1").Range("H20") Then MsgBox "Checked" Else MsgBox "Not Checked" End If End Sub *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What is wrong with the code? | Excel Discussion (Misc queries) | |||
What's wrong with this code??? | Excel Programming | |||
HELP! What's wrong with my code? | Excel Programming | |||
What is wrong with this code? | Excel Programming | |||
What's wrong w/my code? | Excel Programming |