Exporting to Excel Spreadsheet

Hello,

I am exporting datat into an excel spreadsheet and I need the text in certain cells to be certain colors.  This is one that I need to change the color to:  xlSheet.Cells(6, 3).Value = "L1I".  I need L1I to be red.  Please help?!

Subject: Exporting to Excel Spreadsheet

Two options come to mind.If you’re using a Lotusscript agent to perform the export, you should be able to set the foreground or background colour as part of the process.

Alternatively, export to a pre-formatted spreadsheet in which you’ve set conditional formats to look for certain values in certain cells.

Subject: RE: Exporting to Excel Spreadsheet

I know I should be able to. I am not able to figure out the “line of code” that will change it. That was the question I asked. What would be the “line of code” I would need to use?

Subject: RE: Exporting to Excel Spreadsheet

Range("C5").SelectGo into Microsoft Excel. Record a macro while doing what you're trying to program (turn the cell red). Then hit Alt-F11 and check out the code.   

With Selection.Font

    .Name = "Arial"

    .FontStyle = "Regular"

    .Size = 10

    .Strikethrough = False

    .Superscript = False

    .Subscript = False

    .OutlineFont = False

    .Shadow = False

    .Underline = xlUnderlineStyleNone

    .ColorIndex = 3

End With

Subject: RE: Exporting to Excel Spreadsheet

Thank you very much!