#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Value Issue


Hi All,

I have a value in cell A1. The format of cell is General.
Now using a function I am checking if the value is = 0.35 like
below...

sub test()

Dim TestValue as double

TestValue=Range("A2").VALUE

If TestValue = 0.35 then
msgbox "Yes"
End if
end sub

The strange thing is when the value in the Cell A1 is 0.35 still the
condition is not satsified. I checked the Value of the TestValue by
putting the cusrson on it and 0.35. So when TestValue is 0.35 and
condition is 0.35 then why don't the if does't work.

I understand this is a little strange. Any help would be greatly
appreciated.

Thanks
Ankur
www.xlmacros.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Value Issue

Ankur,
Paste the actual code you are using. This cannot be the real code because
"msgbox" would be "MsgBox".
Does it say 0.35 in the formula bar for that cell ?

NickHK

"ankur" wrote in message
oups.com...

Hi All,

I have a value in cell A1. The format of cell is General.
Now using a function I am checking if the value is = 0.35 like
below...

sub test()

Dim TestValue as double

TestValue=Range("A2").VALUE

If TestValue = 0.35 then
msgbox "Yes"
End if
end sub

The strange thing is when the value in the Cell A1 is 0.35 still the
condition is not satsified. I checked the Value of the TestValue by
putting the cusrson on it and 0.35. So when TestValue is 0.35 and
condition is 0.35 then why don't the if does't work.

I understand this is a little strange. Any help would be greatly
appreciated.

Thanks
Ankur
www.xlmacros.com



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Value Issue


Thanks Nick.
Nick. the round function solved it.

Rgrds
Ankur
www.xlmacros.com

NickHK wrote:

Ankur,
Paste the actual code you are using. This cannot be the real code because
"msgbox" would be "MsgBox".
Does it say 0.35 in the formula bar for that cell ?

NickHK

"ankur" wrote in message
oups.com...

Hi All,

I have a value in cell A1. The format of cell is General.
Now using a function I am checking if the value is = 0.35 like
below...

sub test()

Dim TestValue as double

TestValue=Range("A2").VALUE

If TestValue = 0.35 then
msgbox "Yes"
End if
end sub

The strange thing is when the value in the Cell A1 is 0.35 still the
condition is not satsified. I checked the Value of the TestValue by
putting the cusrson on it and 0.35. So when TestValue is 0.35 and
condition is 0.35 then why don't the if does't work.

I understand this is a little strange. Any help would be greatly
appreciated.

Thanks
Ankur
www.xlmacros.com


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 believe that this is a set up issue... jsylvester Setting up and Configuration of Excel 2 January 21st 09 06:41 PM
SUM Issue.. HELP Setting a Mileage Expense Report[_2_] Excel Discussion (Misc queries) 4 November 15th 07 06:49 PM
Issue [email protected] Excel Discussion (Misc queries) 1 July 21st 06 05:13 AM
For Next Issue darkman Excel Programming 5 May 24th 06 08:40 AM
Issue with zero/# issue!! drvortex Excel Worksheet Functions 4 December 6th 05 06:22 PM


All times are GMT +1. The time now is 01:47 PM.

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

About Us

"It's about Microsoft Excel"