+ Reply to Thread
Results 1 to 3 of 3

Compare cells

Hybrid View

  1. #1
    Registered User
    Join Date
    02-22-2006
    Posts
    28

    Question Compare cells

    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.

  2. #2
    CLR
    Guest

    RE: Compare cells

    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
    >
    >


  3. #3
    Registered User
    Join Date
    02-22-2006
    Posts
    28
    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1