![]() |
Code Question
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 |
Code Question
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 |
Code Question
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 |
Code Question
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 |
All times are GMT +1. The time now is 05:49 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com