Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What is wrong with this simple code. It always returns "equals"?
Private Sub Worksheet_Activate() If H20 < I20 Then MsgBox "does not equal" Else _ MsgBox "equals" End Sub Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think excel is treating H20 and I20 as variables (whose values are both
zero). Try: If Range("H20").Value < Range("I20").Value "Ronbo" wrote: What is wrong with this simple code. It always returns "equals"? Private Sub Worksheet_Activate() If H20 < I20 Then MsgBox "does not equal" Else _ MsgBox "equals" End Sub Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, it works perfect.
"JMB" wrote: I think excel is treating H20 and I20 as variables (whose values are both zero). Try: If Range("H20").Value < Range("I20").Value "Ronbo" wrote: What is wrong with this simple code. It always returns "equals"? Private Sub Worksheet_Activate() If H20 < I20 Then MsgBox "does not equal" Else _ MsgBox "equals" End Sub Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
you're welcome.
"Ronbo" wrote: Thanks, it works perfect. "JMB" wrote: I think excel is treating H20 and I20 as variables (whose values are both zero). Try: If Range("H20").Value < Range("I20").Value "Ronbo" wrote: What is wrong with this simple code. It always returns "equals"? Private Sub Worksheet_Activate() If H20 < I20 Then MsgBox "does not equal" Else _ MsgBox "equals" End Sub Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA code question | Excel Discussion (Misc queries) | |||
question on VB code | Excel Discussion (Misc queries) | |||
code question | Excel Programming | |||
Please help with vba code question | Excel Programming | |||
VBA CODE Question | Excel Programming |