Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you, Norman. I never would have figured that one out by myself.
That's a huge help! "Norman Jones" wrote: 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. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your reply to Norman must be one of those "phantom thank-you's" that just doesn't show up in the same thread. Also, it wasn't you
who was being called a jerk, it was the other guy who was getting help from Bob, but wasn't satisfied after an hour so he re-posted the same problem. I didn't lecture you at all. My note was to Norman, not to you, and it is still valid. Call me whatever you want. -- RMC,CPA "MysticMarley" wrote in message ... 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. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I accept your apology.
"R. Choate" wrote: Your reply to Norman must be one of those "phantom thank-you's" that just doesn't show up in the same thread. Also, it wasn't you who was being called a jerk, it was the other guy who was getting help from Bob, but wasn't satisfied after an hour so he re-posted the same problem. I didn't lecture you at all. My note was to Norman, not to you, and it is still valid. Call me whatever you want. -- RMC,CPA "MysticMarley" wrote in message ... 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. |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Richard,
Speaking purely from a personal perspective, I do not feel it incumbent upon a poster to respond to proffered assistance with thanks - which is not to say that it is other than rewarding if they do! If I choose to respond to a posted question, it is primarily a selfish reaction: the pleasure that *I* derive and the concomitant self-learning experience considerably outweigh the dubious merits of my response. Of course, I must now thank you and I do so, not from any sense of obligation, but in appreciation of your sentiments As an aside, 'missing' posts can make fools of all of us: nobody, I am sure, feels more foolish than I do when, having posted a response to the NG, I subsequently discover responses that are not only notably superior but significantly pre-date my efforts.I am afraid that 'phantom' or missing posts are an integral part of the newsresder experience. Thank you again, Richard! --- Regards, Norman "R. Choate" wrote in message ... 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF statement in macro | Excel Worksheet Functions | |||
Run Macro From If Statement | Excel Discussion (Misc queries) | |||
Macro and If Statement | Excel Discussion (Misc queries) | |||
HELP w/ Macro and IF Statement | Excel Programming | |||
Macro statement | Excel Programming |