Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / February 2007

Tip: Looking for answers? Try searching our database.

How to restore cells forecolor back to black?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jack - 23 Feb 2007 20:50 GMT
Hello,
          My vb app interacts with Excel spreadsheet and changes fore color
of some cells.
Is there any general method of restoring back black color to all the cells?
Jack
Chip Pearson - 23 Feb 2007 23:07 GMT
Try something like

Sub ColorAutomatic()
   Dim WS As Excel.Worksheet
   Set WS = XLApp.ActiveWorkbook.Worksheets("Sheet1")
   WS.UsedRange.Font.ColorIndex = xlColorIndexAutomatic
End Sub

where XLApp is your Excel Application object.

Signature

Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)

> Hello,
>           My vb app interacts with Excel spreadsheet and changes fore
> color of some cells.
> Is there any general method of restoring back black color to all the
> cells?
> Jack
Earl Kiosterud - 23 Feb 2007 23:08 GMT
Jack,

Cells.Font.ColorIndex = 0

Signature

Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------

> Hello,
>           My vb app interacts with Excel spreadsheet and changes fore color of some cells.
> Is there any general method of restoring back black color to all the cells?
> Jack
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.