I don't know how to set a single cell for 2 different colors. For example, ' * Required Field ' which '*' is color red and 'Required Field' is color black.
please help...If you need to use activex automation i.e. VBA, then the following should do it (else look below)
Range("F10").Select
ActiveCell.FormulaR1C1 = "* Required Field"
With ActiveCell.Characters(Start:=1, Length:=1).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 46
End With
With ActiveCell.Characters(Start:=3, Length:=14).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Range("F10").Select
if you need to do it using the visual gui in Excel you can do it by going into the edit mode of the cell, selecting the text individually and changing the formatting of the font.
thanks Manasvin. i try it out and solve the problem already. its really work.
You don't want to do office automation for a web page though. It's not going to scale well. One possibility is to create some html that is formatted correctly in a table, and return that HTML as an Excel file. Excel will accept the format correctly.
Alternatively, if you can support later versions of Excel (2002), you can use XML instead.
hallo oog,
how to return the HTML (table formatted) as an Excel file. Can you give me a example how to implement it.
thanks
0 comments:
Post a Comment