Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default RGB fill colors

I am using the macros shown below this post to change the fill colors of
some cells.
Sub Pink, Sub Green, etc., transfer the color code to the main macro,
ChangeSceneColour.

But the colors are too strong and I need to use much softer colours.
(These are cells where I cannot change transparency.)
What I should like to do is define the color in RGB.
I know it wont work but this is what I should like:

Sub PalePink()
FillColour = RGB(255,240,245)
ChangeSceneColour
End Sub

Any suggestions, bearing in mind
a) the workbook will be used by a few friends
b) before I finish the workbook I should like to easily modify the colours.

Francis Hookham

------------------------------------------------------------

Sub Pink()
FillColour = 7
ChangeSceneColour
End Sub

Sub Green()
FillColour = 4
ChangeSceneColour
End Sub

Sub ChangeSceneColour()
Count = ActiveCell.Row
While Cells(Count, 2) < "Scene:"
Count = Count - 1
Wend
Range(Cells(Count, 2), Cells(Count + 15, 7)). _
Interior.ColorIndex = FillColour
Cells(Count, 3).Interior.ColorIndex = xlNone
Cells(Count, 5).Interior.ColorIndex = xlNone
Cells(Count, 7).Interior.ColorIndex = xlNone
Cells(Count, 3).Select
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default RGB fill colors

If the colour you want is not available in the palette, customize one of the
56 palette colours (only 40 visible in the cell's drop down Fill & Font
palettes). Eg, customize Colorindex 38, the colour under default pink

ActiveWorkbook.Colors(38) = RGB(255, 240, 245)
or manually see the Color Tab in Tools Options

If you have used the colour in that palette location anywhere in your
workbook the format will change to the newly customized colour (although of
course the format itself does not change).

Now you can either manually apply your new customized colour or do

Dim rng as range
Set rng = Range("C2:D4")
rng.Interior.Colorindex = 38

The palette with any customized colours is stored with the workbook. A
customized palette does not change any application type settings.

Afraid I don't really follow what you are trying to do with your code,
except I notice

Count = ActiveCell.Row
While Cells(Count, 2) < "Scene:"
Count = Count - 1
Wend


eventually will fail when the variable Count gets to Zero (btw, best not to
use keywords like 'Count' as variable names).

Regards,
Peter T


"Francis Hookham" wrote in message
...
I am using the macros shown below this post to change the fill colors of
some cells.
Sub Pink, Sub Green, etc., transfer the color code to the main macro,
ChangeSceneColour.

But the colors are too strong and I need to use much softer colours.
(These are cells where I cannot change transparency.)
What I should like to do is define the color in RGB.
I know it wont work but this is what I should like:

Sub PalePink()
FillColour = RGB(255,240,245)
ChangeSceneColour
End Sub

Any suggestions, bearing in mind
a) the workbook will be used by a few friends
b) before I finish the workbook I should like to easily modify the

colours.

Francis Hookham

------------------------------------------------------------

Sub Pink()
FillColour = 7
ChangeSceneColour
End Sub

Sub Green()
FillColour = 4
ChangeSceneColour
End Sub

Sub ChangeSceneColour()
Count = ActiveCell.Row
While Cells(Count, 2) < "Scene:"
Count = Count - 1
Wend
Range(Cells(Count, 2), Cells(Count + 15, 7)). _
Interior.ColorIndex = FillColour
Cells(Count, 3).Interior.ColorIndex = xlNone
Cells(Count, 5).Interior.ColorIndex = xlNone
Cells(Count, 7).Interior.ColorIndex = xlNone
Cells(Count, 3).Select
End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default RGB fill colors

Hi Francis

The value of the variable FillColor is not transferred to the macro
ChangeSceneColor. You have to define the variable FillColour as public before
any macro.

regards
reklamo


"Francis Hookham" wrote:

I am using the macros shown below this post to change the fill colors of
some cells.
Sub Pink, Sub Green, etc., transfer the color code to the main macro,
ChangeSceneColour.

But the colors are too strong and I need to use much softer colours.
(These are cells where I cannot change transparency.)
What I should like to do is define the color in RGB.
I know it wont work but this is what I should like:

Sub PalePink()
FillColour = RGB(255,240,245)
ChangeSceneColour
End Sub

Any suggestions, bearing in mind
a) the workbook will be used by a few friends
b) before I finish the workbook I should like to easily modify the colours.

Francis Hookham

------------------------------------------------------------

Sub Pink()
FillColour = 7
ChangeSceneColour
End Sub

Sub Green()
FillColour = 4
ChangeSceneColour
End Sub

Sub ChangeSceneColour()
Count = ActiveCell.Row
While Cells(Count, 2) < "Scene:"
Count = Count - 1
Wend
Range(Cells(Count, 2), Cells(Count + 15, 7)). _
Interior.ColorIndex = FillColour
Cells(Count, 3).Interior.ColorIndex = xlNone
Cells(Count, 5).Interior.ColorIndex = xlNone
Cells(Count, 7).Interior.ColorIndex = xlNone
Cells(Count, 3).Select
End Sub



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default RGB fill colors

Many thanks Peter (and reklamo)
ActiveWorkbook.Colors(38) = RGB(255, 240, 245)
is just what I wanted.

"While Cells(Count, 2) < "Scene:"" is ok in this situation - the macro
needs to look for latest occurance of "Scene" in column 2.

Everything is woking as it should now.

Francis

"Peter T" <peter_t@discussions wrote in message
...
If the colour you want is not available in the palette, customize one of
the
56 palette colours (only 40 visible in the cell's drop down Fill & Font
palettes). Eg, customize Colorindex 38, the colour under default pink

ActiveWorkbook.Colors(38) = RGB(255, 240, 245)
or manually see the Color Tab in Tools Options

If you have used the colour in that palette location anywhere in your
workbook the format will change to the newly customized colour (although
of
course the format itself does not change).

Now you can either manually apply your new customized colour or do

Dim rng as range
Set rng = Range("C2:D4")
rng.Interior.Colorindex = 38

The palette with any customized colours is stored with the workbook. A
customized palette does not change any application type settings.

Afraid I don't really follow what you are trying to do with your code,
except I notice

Count = ActiveCell.Row
While Cells(Count, 2) < "Scene:"
Count = Count - 1
Wend


eventually will fail when the variable Count gets to Zero (btw, best not
to
use keywords like 'Count' as variable names).

Regards,
Peter T


"Francis Hookham" wrote in message
...
I am using the macros shown below this post to change the fill colors of
some cells.
Sub Pink, Sub Green, etc., transfer the color code to the main macro,
ChangeSceneColour.

But the colors are too strong and I need to use much softer colours.
(These are cells where I cannot change transparency.)
What I should like to do is define the color in RGB.
I know it wont work but this is what I should like:

Sub PalePink()
FillColour = RGB(255,240,245)
ChangeSceneColour
End Sub

Any suggestions, bearing in mind
a) the workbook will be used by a few friends
b) before I finish the workbook I should like to easily modify the

colours.

Francis Hookham

------------------------------------------------------------

Sub Pink()
FillColour = 7
ChangeSceneColour
End Sub

Sub Green()
FillColour = 4
ChangeSceneColour
End Sub

Sub ChangeSceneColour()
Count = ActiveCell.Row
While Cells(Count, 2) < "Scene:"
Count = Count - 1
Wend
Range(Cells(Count, 2), Cells(Count + 15, 7)). _
Interior.ColorIndex = FillColour
Cells(Count, 3).Interior.ColorIndex = xlNone
Cells(Count, 5).Interior.ColorIndex = xlNone
Cells(Count, 7).Interior.ColorIndex = xlNone
Cells(Count, 3).Select
End Sub






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
Used drawing colors in shapes....lost default colors for "Fill Col Lai704 Excel Discussion (Misc queries) 1 August 20th 08 04:45 AM
Worksheet formatting (fill colors & text colors) disappeared sweettooth Excel Discussion (Misc queries) 2 June 24th 08 01:16 AM
Fill Colors mlsintx Excel Discussion (Misc queries) 4 October 16th 06 10:17 AM
Can't format font colors or cell fill-in colors canoeron Excel Discussion (Misc queries) 3 August 22nd 05 11:46 PM
Better Fill Colors? callmekilo Excel Discussion (Misc queries) 1 January 2nd 05 03:34 PM


All times are GMT +1. The time now is 10:14 AM.

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

About Us

"It's about Microsoft Excel"