How to restore cells forecolor back to black?

J

Jack

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
 
C

Chip Pearson

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.


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