PC Review


Reply
Thread Tools Rate Thread

Compare cells

 
 
mtpsuresh
Guest
Posts: n/a
 
      22nd Feb 2006

Hi,

Can anyone help me out pls.

I am trying to compare two values

if application.worksheetfunction.sum(Range("A1:A2") <>Range("A3").value
then
msgbox "NotEqual"
end if

For Eg:
A1= 676821.92
A2=40936.43
A3=717758.35
it says it is not equal. But if i add VBA.VAL on both side of the
expressions, it doesnt display any message. I really dont get this.


--
mtpsuresh
------------------------------------------------------------------------
mtpsuresh's Profile: http://www.excelforum.com/member.php...o&userid=31817
View this thread: http://www.excelforum.com/showthread...hreadid=515439

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q0xS?=
Guest
Posts: n/a
 
      22nd Feb 2006
Sub equal()
If Range("a1").Value + Range("a2").Value <> Range("A3").Value Then
MsgBox "Not Equal"
Else
MsgBox "Equal"
End If
End Sub


Vaya con Dios,
Chuck, CABGx3

"mtpsuresh" wrote:

>
> Hi,
>
> Can anyone help me out pls.
>
> I am trying to compare two values
>
> if application.worksheetfunction.sum(Range("A1:A2") <>Range("A3").value
> then
> msgbox "NotEqual"
> end if
>
> For Eg:
> A1= 676821.92
> A2=40936.43
> A3=717758.35
> it says it is not equal. But if i add VBA.VAL on both side of the
> expressions, it doesnt display any message. I really dont get this.
>
>
> --
> mtpsuresh
> ------------------------------------------------------------------------
> mtpsuresh's Profile: http://www.excelforum.com/member.php...o&userid=31817
> View this thread: http://www.excelforum.com/showthread...hreadid=515439
>
>

 
Reply With Quote
 
mtpsuresh
Guest
Posts: n/a
 
      23rd Feb 2006

Thanks Vaya con Dios.

But still it thows the same message. But if i add trim() on both sides
it doesnt display the message.

Thanks for your response.


--
mtpsuresh
------------------------------------------------------------------------
mtpsuresh's Profile: http://www.excelforum.com/member.php...o&userid=31817
View this thread: http://www.excelforum.com/showthread...hreadid=515439

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare 1 cell to column of cells returning adjacent cells info? Mr. Fine Microsoft Excel Worksheet Functions 1 15th Apr 2010 07:36 PM
Compare 4 cells John Microsoft Access 1 10th Jul 2008 02:09 PM
How do I compare cells and if FALSE compare to next cell in EXCEL =?Utf-8?B?Q2luZGll?= Microsoft Excel Worksheet Functions 0 24th Mar 2006 05:29 PM
Compare two cells from reference cells =?Utf-8?B?TWlrZSBL?= Microsoft Excel Worksheet Functions 2 26th Nov 2005 02:07 PM
Compare 2 cells in 2 worksheets, rewrite one of the cells dbomb Microsoft Excel Programming 1 28th Sep 2004 09:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:33 PM.