Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default code to choose tab color?

It works for me.

1. Did you specify the sheet?...
Worksheets(1).Tab.ColorIndex = n
2. Are you using Excel 2002 or a later version?
3. Is N declared as a Long?
4. Try using "Randomize" as a single line just before "n =..."
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Mekinnik"
wrote in message
I have tried this line of code I found in the community forums, but it does
not produce random numbers as far as color numbers go, when I reset the the
macro and start again it produces the same number/color. Does anyone have any
suggestions to this problem?

n = Int((54 * Rnd) + 1)
..Tab.ColorIndex = n

"Mekinnik" wrote:

How can I make the following line of code randomly choose the tab color
index? I would like the code automaticlly color the tab not me choose it.

.Tab.ColorIndex = 3

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
How do I choose font color while tracking changes. CapitalCity Excel Discussion (Misc queries) 1 August 12th 09 03:22 AM
choose a specific color for my chart Berit Charts and Charting in Excel 1 June 18th 09 01:23 PM
Colored Contact Lenses - How To Choose The Color That Is Best For You [email protected] Excel Discussion (Misc queries) 0 January 22nd 08 10:12 PM
How to color automatically color code sums in cells kuroitenpi Charts and Charting in Excel 1 November 29th 06 03:16 AM
Choose printout color or b/w using vba Jonsson[_46_] Excel Programming 2 July 19th 05 08:53 PM


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