Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Getting color of each cell in selection

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Getting color of each cell in selection

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Getting color of each cell in selection

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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Getting color of each cell in selection

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the color of Cell Selection? ks Excel Discussion (Misc queries) 2 December 18th 09 08:24 PM
Cell Range Selection Color WCMOUSER Excel Discussion (Misc queries) 1 October 18th 08 04:51 PM
How can I darken the cell selection highlight color JBIBelt Excel Discussion (Misc queries) 3 April 29th 08 04:53 PM
How do I change the color for cell selection in excel? dminliberty New Users to Excel 8 March 19th 08 02:42 PM
Change Cell background color by selection Bob Wall Excel Worksheet Functions 1 August 27th 06 02:13 AM


All times are GMT +1. The time now is 04:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"