Visual Basic Excel Macro Q
#1
What I want to do is so easy, it's downright silly, yet I cannot figure out how to do it...

Does anybody here know how to make an If-Then statement which basically says:

If cell A1 = "word" then B1 = "message"

All my attempts have failed. I've tried .select, .range, activecell, varient, everything for the darn program to acknowledge cell A1 as a text based string, and once the code goes off without any debug problems... it still does not work. Even if it somehow sees A1 the way it's suppose too, it does not seem to recognize "word" as the string to compare it too. In Excel, the code would be so simple, in Cell B1:"=IF(A1="word","message","")", but I don't know what I'm doing wrong in VB.

EDIT: Whee look at me, I'm an idiot... I forgot to Dim my values as Range and I was wondering why they wouldn't work when I tried to set them. Never-mind; nothing to see here.
"The true value of a human being is determined primarily by the measure and the sense in which he has attained liberation from the self." -Albert Einsetin
Reply


Messages In This Thread
Visual Basic Excel Macro Q - by Taem - 05-19-2010, 02:58 AM
RE: Visual Basic Excel Macro Q - by kandrathe - 05-19-2010, 05:46 PM
RE: Visual Basic Excel Macro Q - by Taem - 05-20-2010, 12:03 AM
RE: Visual Basic Excel Macro Q - by Maitre - 05-20-2010, 02:24 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)