Monday, February 8, 2010

Colors and Boarders of Cells in Excel Sheet.

dim excel

set excel=WScript.CreateObject("Excel.Application")

excel.visible=true

dim wb
dim ws
dim range

set wb=excel.WorkBooks.Add()

set ws=wb.Sheets("Sheet1")

for i=1 to 56

set range=ws.Cells(i,1)

set clr=ws.cells(i,1)

with clr

.interior.colorindex=i

end with

with range.Borders '(xlEdgeRight)

.LineStyle=1 ' 1 for continuous line

.Weight=2 'Thin line.. 1 for hairline, -4138 for medium, 4 for thick Boarders and 2 for thin.

.ColorIndex=1 '(xlAutomatic - -4105) You can provide the border line as you like... (1 to 56)

end with

Next

set wb=nothing

set ws=nothing

set excel=nothing


Thanks & Regards
Baba Fakruddin.D
baba.fakru@gmail.com

No comments:

There was an error in this gadget