Consulting

Results 1 to 3 of 3

Thread: Solved: Compare cells contents (VBA)

  1. #1
    VBAX Newbie
    Joined
    Jan 2011
    Posts
    2
    Location

    Solved: Compare cells contents (VBA)

    Hi everyone, I'm new at this so forgive me, I'v tried to search for any post but counld'nt find it.

    I'm triing to do something simple but it's giving me headache . I want to compare the result of a cell with a variable

    EX: if cells(3,2),value = a then ...

    but my problem is that cells 3,2 is actually a formulla ( =[Book2]Sheet1!$A$1) and so my IF is (I think) comparing the formulla with a. is there a way to compare the result of that cells instaid of the contents of the cell?

    thanks to all!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    No it doesn't, by using .Value it looks at the value. You would need to use .Formula to see the formula.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Newbie
    Joined
    Jan 2011
    Posts
    2
    Location
    I knew it was something simple !

    thanks!

Posting Permissions

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