In response to questions I have received about Sending Vbs Results to Microsoft Excel files here is a brief script that will create a numeric list of the colors available for use with the Excel objects Interior and Font Color Indexes.
In my previous post examples I have lines that read as follows that sets the color values for the Interior (Background) and Font Colors:
After running the Vbs script below a Microsoft Excel workbook will open with the colors available for use with the Excel Object ColorIndex(s) and their associated numeric values.
To modify my original posts change the numeric values 19 or 11 with the colors numeric values of your choice.
For example if you want the font to appear as yellow (6) and the cells background to appear as a light gray (15) change the script lines above as follows:
objExcel.Selection.Interior.ColorIndex = 15objExcel.Selection.Font.ColorIndex = 6
Vbs Script:
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
For a = 1 to 56
objExcel.Cells(a, 1).Value = a
objExcel.Cells(a, 1).Interior.ColorIndex = a
Next
In a previous post last year entitled Creating a Microsoft Excel Spreadsheet With Excel Color Values