Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings:
In trying to modify and copy some code posted on this board, I'm unsuccessful in trying to get the color of each cell and throw an error message. Based on the user needs, I need them to select a range of cells (fortunately, in the same row), click a command button, and then send an Outlook appointment item--that part's easy. So, recipients that are properly scheduled have their cells changed to green; others are orange. Thus, this is what I'm trying to do in the sub: Dim rng As Range For Each rng in Selection If rng.Interior.ColorIndex < 4 -- Brian J. Matuschak |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What problem are you having? The code you posted should work.
-- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Brian J. Matuschak" wrote in message ... Greetings: In trying to modify and copy some code posted on this board, I'm unsuccessful in trying to get the color of each cell and throw an error message. Based on the user needs, I need them to select a range of cells (fortunately, in the same row), click a command button, and then send an Outlook appointment item--that part's easy. So, recipients that are properly scheduled have their cells changed to green; others are orange. Thus, this is what I'm trying to do in the sub: Dim rng As Range For Each rng in Selection If rng.Interior.ColorIndex < 4 -- Brian J. Matuschak |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
D'OH! Thanks for your help.
-- Brian J. Matuschak "Brian J. Matuschak" wrote: Here's the full snippet that I posted in a message a couple of minutes later: Dim rng As Range For Each rng in Selection If rng.Interior.ColorIndex < 4 Then MsgBox "You did not select the correct cells for scheduling", vbCritical, "Improper Selection" End If Exit Sub Next Basically, it just skips over the code. Thanks for your reply, -- Brian J. Matuschak "Chip Pearson" wrote: What problem are you having? The code you posted should work. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Brian J. Matuschak" wrote in message ... Greetings: In trying to modify and copy some code posted on this board, I'm unsuccessful in trying to get the color of each cell and throw an error message. Based on the user needs, I need them to select a range of cells (fortunately, in the same row), click a command button, and then send an Outlook appointment item--that part's easy. So, recipients that are properly scheduled have their cells changed to green; others are orange. Thus, this is what I'm trying to do in the sub: Dim rng As Range For Each rng in Selection If rng.Interior.ColorIndex < 4 -- Brian J. Matuschak |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Changing the color of Cell Selection? | Excel Discussion (Misc queries) | |||
Cell Range Selection Color | Excel Discussion (Misc queries) | |||
How can I darken the cell selection highlight color | Excel Discussion (Misc queries) | |||
How do I change the color for cell selection in excel? | New Users to Excel | |||
Change Cell background color by selection | Excel Worksheet Functions |