Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 166
Default Font.ColorIndex

Does anyone know why

debug.print Worksheets("Sheet").Range("C955").Font.ColorIndex

sometimes returns a negative 4 digit number (e.g. -4105)
when it should return something else entirely, like a 7?

Thanks - Kirk
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Font.ColorIndex

Hi,

It will return that if the colorindex is xlautomatic

Try this

Range("a1").Font.ColorIndex = xlAutomatic
Debug.Print Worksheets("Sheet").Range("a1").Font.ColorIndex


Mike

"kirkm" wrote:

Does anyone know why

debug.print Worksheets("Sheet").Range("C955").Font.ColorIndex

sometimes returns a negative 4 digit number (e.g. -4105)
when it should return something else entirely, like a 7?

Thanks - Kirk

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 166
Default Font.ColorIndex

On Fri, 6 Feb 2009 00:39:02 -0800, Mike H
wrote:

Hi,

It will return that if the colorindex is xlautomatic

Try this

Range("a1").Font.ColorIndex = xlAutomatic
Debug.Print Worksheets("Sheet").Range("a1").Font.ColorIndex


Thanks Mike. I found that first line turns the text to black and
-4105 is the result.

Does this mean if you set it to NOT xlAutomtatic it will return
(what seems) the right number ?

How would you make it so, and does this also change the text colour?
I'd rather just detect the colour, not alter it.
Cheers - Kirk
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
.Font.ColorIndex Delay Question Louis[_4_] Excel Programming 3 June 20th 08 01:09 PM
Can't set font.colorindex from VBA Mike Jamesson Excel Programming 4 August 19th 05 02:20 PM
VBA Error setting Font.ColorIndex Steve Barnett Excel Programming 4 June 24th 05 11:00 AM
If Font.ColorIndex = 5 then . . . jeremy nickels Excel Programming 2 March 4th 05 11:29 AM
Font and Fill ColorIndex Frank[_19_] Excel Programming 3 October 31st 03 01:52 PM


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