All
I need to create an Access module which exports some data into an Excel 2007-file. I also need to define a conditional formatting. I started by recording the macro in Excel. Next I copied it into an Access module and tried to get it work.
My current code in the Access module:
The code first fails on
When I remark that line, the code continues until
Same issue happens some lines below.
The IconSet = xl3Symbols2 creates in the cell a green circle (<2440), a yellow triangle (=> 2440 and < 3000) or a red square (=>3000) followed by the effective value.
An easy solution is just to show the values in green, yellow or red color. However, I am obliged to use the green circle, yellow triangle and red square as extra indicator.
Does someone know how to solve this (or an alternative with those indicators)?
Regards
Ino
I need to create an Access module which exports some data into an Excel 2007-file. I also need to define a conditional formatting. I started by recording the macro in Excel. Next I copied it into an Access module and tried to get it work.
My current code in the Access module:
Code:
Dim oExcel, obook, osheet As Object
Set oExcel = CreateObject("Excel.Application")
Set obook = oExcel.Workbooks.Add
Set osheet = obook.Worksheets(1)
osheet.Range("A1").FormatConditions.AddIconSetCondition
osheet.Range("A1").FormatConditions(1).SetFirstPriority
With osheet.Range("A1").FormatConditions(1)
.ReverseOrder = False
.ShowIconOnly = False
.IconSet = xl3Symbols2
End With
osheet.Range("A1").FormatConditions(1).IconCriteria(1).Icon = xlIconGreenCheck
With osheet.Range("A1").FormatConditions(1).IconCriteria(2)
.Type = xlConditionValueNumber
.Value = 2440
.Operator = 5
.Icon = xlIconYellowExclamation
End With
With osheet.Range("A1").FormatConditions(1).IconCriteria(3)
.Type = xlConditionValueNumber
.Value = 3000
.Operator = 7
.Icon = xlIconRedCross
End With
Code:
osheet.Range("A1").FormatConditions(1).IconCriteria(1).Icon = xlIconGreenCheck
Code:
.Icon = xlIconYellowExclamation
The IconSet = xl3Symbols2 creates in the cell a green circle (<2440), a yellow triangle (=> 2440 and < 3000) or a red square (=>3000) followed by the effective value.
An easy solution is just to show the values in green, yellow or red color. However, I am obliged to use the green circle, yellow triangle and red square as extra indicator.
Does someone know how to solve this (or an alternative with those indicators)?
Regards
Ino