How to restore cells forecolor back to black?

  • Thread starter Thread starter Jack
  • Start date Start date
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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top