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


i am having difficulty getting this to work.
basically, this part of the program is to reset the colored fonts an
interior color of the cells etc from the last run of the macro.

I'm getting an error, AND also, when this is executed, the "fake
default gridlines disappear altogether. Can someone steer me in th
right direction?

thank you.

ActiveSheet.Cells.Font.ColorIndex = xlColorIndexAutomatic
ActiveSheet.Cells.Interior.ColorIndex = xlColorIndexAutomatic

ActiveSheet.GridlineColorIndex = xlColorIndexAutomatic
'the last one is the troublesome lin

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default vba gridlinecolorindex question


actually on further testing, the second line is the problem.
This was only supposed to change the cells with colored background bac
to origional default.. Instead it eliminates the grey default gridline
that excel has (which dont print)
I would like to have those visible, is there a way to erase th
interior color of the cells and not eliminate the grey gridlines

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default vba gridlinecolorindex question

Sure, use the correct constant which is xlNone or xlColorIndexNone

This is spelled out pretty clearly in the help for the colorindex property:

For interior:
Set this property to xlColorIndexNone to specify that you don't want an
interior fill.

--
Regards,
Tom Ogilvy


"chick-racer" wrote in message
...

actually on further testing, the second line is the problem.
This was only supposed to change the cells with colored background back
to origional default.. Instead it eliminates the grey default gridlines
that excel has (which dont print)
I would like to have those visible, is there a way to erase the
interior color of the cells and not eliminate the grey gridlines?


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default vba gridlinecolorindex question

ActiveSheet.Cells.Font.ColorIndex = xlColorIndexAutomatic
ActiveSheet.Cells.Interior.ColorIndex = xlColorIndexNone

Not sure what you are trying to do with the last command, but if you have
used borders, then you need to work with the borders object.

Turn on the macro recorder and make the changes you want to get the code.

--
Regards,
Tom Ogilvy


"chick-racer" wrote in message
...

i am having difficulty getting this to work.
basically, this part of the program is to reset the colored fonts and
interior color of the cells etc from the last run of the macro.

I'm getting an error, AND also, when this is executed, the "fake"
default gridlines disappear altogether. Can someone steer me in the
right direction?

thank you.

ActiveSheet.Cells.Font.ColorIndex = xlColorIndexAutomatic
ActiveSheet.Cells.Interior.ColorIndex = xlColorIndexAutomatic

ActiveSheet.GridlineColorIndex = xlColorIndexAutomatic
'the last one is the troublesome line


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



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
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
Question 1 of ??? Connie Martin Excel Worksheet Functions 3 August 9th 08 11:28 PM
where can I see my question and answer? Yesterday I ask a question IP Excel Discussion (Misc queries) 2 May 10th 08 04:08 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
The question is an excel question that I need to figure out howto do in excel. Terry Excel Worksheet Functions 3 January 23rd 06 06:22 PM


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