hcl-bot
1
Hallo to everybody.can someone help me?
I must color a cell of an excellsheet.
I set some property of cell but i don’t know what is the property that permit to change the color.
This is an example of my code :
excelSheet.Cells(m+1, 2).font.bold=True
excelSheet.Cells(m+1, 2).VerticalAlignment = -4107
excelSheet.Cells(m+1, 2).HorizontalAlignment = -4108
excelSheet.Cells(m+1, 2).WrapText = True
excelSheet.Cells(m+1, 2).ShrinkToFit = False
excelSheet.Cells(m+1, 2).MergeCells = False
excelSheet.Cells(m+1, 2).RowHeight = 15
excelSheet.Cells(m+1, 2).AddIndent = False
excelSheet.Cells(m+1, 2).IndentLevel = 0
excelSheet.Cells(m+1, 2).ShrinkToFit = False
Thank’s a lot
hcl-bot
2
Subject: Format excel cell from lotusscript
excelSheet.Cells(m+1, 2).Interior.ColorIndex = intColorIndex
(set intColorIndex to some integer - you may need to experiment)
Subject: RE: Format excel cell from lotusscript
it’s ok, thank’s for your help!!
hcl-bot
4
Subject: RE: Format excel cell from lotusscript
Just in case you wanted to get a visual of the colors, here are the color indexes and their associated colors (on my machine, anyway…)
Sub Colorize()
For m = 0 To 56
ActiveWorkbook.Sheets(“Sheet1”).Cells(m + 1, 1).Value = m
ActiveWorkbook.Sheets(“Sheet1”).Cells(m + 1, 2).Interior.ColorIndex = m
Next m
End Sub
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Subject: Format excel cell from lotusscript
Create a macro in excel of what you want to accomplish. And then step debug it in excel revealing the code behind what you are attempting to perform.