View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
MysticMarley MysticMarley is offline
external usenet poster
 
Posts: 5
Default Can a Macro contain an IF statement? How?

Maybe you should read the replies before you spit your hatred from your rude
pie-hole. Unfortunately, I had to get some sleep after my initial post.
When I arose this morning I read and used Norman's very helpful solution. I
told him so in the "thank you" reply that I posted... an hour before your
posted sanctimonious lecture.

Looks like you're the "jerk", Choate!

"R. Choate" wrote:

Hi Norman,

You know, people used to be very gracious when they got help here. Now I almost never even see anybody say thank you for the help
they just got. Here you helped this guy hours ago and he didn't even say thank you. I chewed some other guy out who calls himself
"Kamakshi" because he was rudely dismissing the help he got from Bob Phillips and just re-posting the problem again just an hour
later. Such a jerk. I sent him a link to the Newsgroup netiquette site so he could do some needed reading. Since this guy wouldn't
thank you for helping him, I will. Thank you for helping this person and anybody else you help, even when you don't get thanked or
acknowledged in any way.

Richard
--
RMC,CPA


"Norman Jones" wrote in message ...
Hi MysticMarley:

Here is a simple example:

'===============
Sub Tester()
Dim rng As Range

Set rng = ActiveSheet.Range("A1")

With rng
If .Value 100 Then
'Do something, e.g.:
.Interior.ColorIndex = 3
Else
'Do something else, e.g.:
.Interior.ColorIndex = 5
End If
End With
End Sub

'<<===============

---
Regards,
Norman



"MysticMarley" wrote in message
...
When my macro starts, I would like for it to reference a value from a cell
then perform one of two actions based upon the value. Is this possible?
Please, explain how.