Thanks
Thanks it works!
Announcement
Collapse
No announcement yet.
Fill Cell in Excel
Collapse
X
-
Knuth
I have to thank you for that one to. I use the macro method but could never get that one to work, or get all the columns to automatically resize to fit the contents. I have done a lot of COM with Word but always have trouble with Excel
John
Leave a comment:
-
Try
Code:OBJECT LET oExcelWorkSheet.Range(vRange).Interior.ColorIndex = <Color index in current palette> OBJECT LET oExcelWorkSheet.Range(vRange).Interior.Pattern = <Pattern constant>
Code:With Selection.Interior .ColorIndex = 6 .Pattern = xlSolid End With
Leave a comment:
-
Fill Cell in Excel
I can change the bold and Font in Excel, but how to change the background colour of a range of cells?
'_____________________________________________________________________________________________________________________
FUNCTION Write_to_Excel(Koo_X AS LONG, Koo_Y AS LONG, schreibe AS VARIANT, farbe AS LONG) ' spalte zeile
DIM vRange AS VARIANT
DIM vVnt AS VARIANT
DIM vVnB AS VARIANT
DIM oExcelWorkSheet AS GLOBAL ExcelWorkSheet
CALL Kolonne(Koo_X,Koo_Y)
LET vRange = koordinaten
'farbe=2
IF farbe=0 THEN LET vVnt = RGB(0,0,0)
IF farbe=1 THEN LET vVnt = RGB(255,0,0) ' Rot
IF farbe=2 THEN LET vVnt = RGB(0,0,255) ' Blau
IF farbe=3 THEN LET vVnt = RGB(0,150,0) ' Grün
IF farbe&>0 THEN vVnB=15
OBJECT LET oExcelWorkSheet.Range(vRange).Font.Color = vVnt
OBJECT LET oExcelWorkSheet.Range(vRange).Font.Bold = vVnB
OBJECT LET oExcelWorkSheet.Range(vRange).Value = schreibe
END FUNCTIONTags: None
Leave a comment: