Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default changing an palette index value programmatically in Excel

Hi all,

I'm stuck, is there any way to change the color a palette index
references from VBA.

for example I want to change the color that colorindex(3) references
from blue to green, that way all my cells that reference colorindex(3)
change from blue to green.

can I do this in VBA?

thanks a lot
b
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default changing an palette index value programmatically in Excel

This is a workbook-level setting. Did you try recording a macro?

Something like:

ActiveWorkbook.Colors(3) = RGB(0, 128, 0)

should work.

--

Vasant




"brad" wrote in message
om...
Hi all,

I'm stuck, is there any way to change the color a palette index
references from VBA.

for example I want to change the color that colorindex(3) references
from blue to green, that way all my cells that reference colorindex(3)
change from blue to green.

can I do this in VBA?

thanks a lot
b



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default changing an palette index value programmatically in Excel

Hi,

Vasant is correct. This is what I insert in one of my
modules, for example, in some of my workbooks. You record
with the macro to get the precise RGB (red-green-blue)
numbers that you want.

Sub Auto_Open()

With ActiveWorkbook
.Colors(2) = RGB(233, 230, 254)
.Colors(11) = RGB(232, 254, 243)
.Colors(15) = RGB(255, 204, 255)
.Colors(16) = RGB(251, 223, 255)
.Colors(19) = RGB(255, 255, 195)
.Colors(34) = RGB(195, 255, 255)
.Colors(35) = RGB(195, 255, 195)
.Colors(47) = RGB(227, 252, 255)
.Colors(48) = RGB(228, 225, 224)
.Colors(49) = RGB(252, 255, 227)
.Colors(55) = RGB(255, 248, 227)
.Colors(56) = RGB(227, 255, 245)
End With

End Sub

Rick

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 Color Palette kaldon Excel Worksheet Functions 2 April 4th 06 01:28 AM
Changing the Excel color palette Don McClure New Users to Excel 2 April 4th 06 12:00 AM
Changing color palette for Excel 2002 Glenn Chung Excel Discussion (Misc queries) 1 May 5th 05 08:22 PM
Changing color in color palette Dave Peterson Setting up and Configuration of Excel 0 December 12th 04 02:39 PM
Programmatically changing cell color Tina Excel Programming 3 September 11th 03 03:36 PM


All times are GMT +1. The time now is 07:19 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"