View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mekinnik Mekinnik is offline
external usenet poster
 
Posts: 159
Default code to choose tab color?

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