#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default If/Then - EASY

I have the following If/Then statement in a macro, the problem is when the
value of the K9 is less than 10 it isn't identified correctly by the if
statement. Is there some easy fix like changing the number format I'm
missing?

If Range("K9") < "37.5" Then
Call Message
Else
Call Macro1
End If
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default If/Then - EASY

Your macro is testing for text. To test for a number you need:

If Range("K9") < 37.5 Then


HTH
Bob

"JRW6277" wrote in message
...
I have the following If/Then statement in a macro, the problem is when the
value of the K9 is less than 10 it isn't identified correctly by the if
statement. Is there some easy fix like changing the number format I'm
missing?

If Range("K9") < "37.5" Then
Call Message
Else
Call Macro1
End If


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default If/Then - EASY

I knew is was something silly like that. Thanks Bob

"Bob Alhat" wrote:

Your macro is testing for text. To test for a number you need:

If Range("K9") < 37.5 Then


HTH
Bob

"JRW6277" wrote in message
...
I have the following If/Then statement in a macro, the problem is when the
value of the K9 is less than 10 it isn't identified correctly by the if
statement. Is there some easy fix like changing the number format I'm
missing?

If Range("K9") < "37.5" Then
Call Message
Else
Call Macro1
End If


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm sure it must be easy BrianH Excel Discussion (Misc queries) 5 October 4th 07 11:31 AM
Easy one... NWO Excel Worksheet Functions 7 September 5th 07 04:39 PM
Is there an easy way to... JCL Excel Discussion (Misc queries) 3 June 1st 06 09:08 AM
Easy one pkbro Excel Worksheet Functions 1 August 5th 05 05:01 PM
new user with easy question? not easy for me speakeztruth New Users to Excel 5 June 3rd 05 09:40 PM


All times are GMT +1. The time now is 05:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"