PDA

View Full Version : Solved: Compare cells contents (VBA)



grunt
01-10-2011, 07:37 PM
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 :banghead: . 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!

Bob Phillips
01-11-2011, 01:34 AM
No it doesn't, by using .Value it looks at the value. You would need to use .Formula to see the formula.

grunt
01-11-2011, 08:44 AM
I knew it was something simple !

thanks!