使用VB.net在Excel中设置条件格式(BarType)?
我想为我的范围添加BarType条件格式 我有:使用VB.net在Excel中设置条件格式(BarType)?,vb.net,excel,ms-office,excel-2007,vba,Vb.net,Excel,Ms Office,Excel 2007,Vba,我想为我的范围添加BarType条件格式 我有: sheet.Range("F3").FormatConditions.AddDatabar() 如何添加: 明点 MaxPoint 巴色 我试过: sheet.Range("F3").FormatConditions(1).MinPoint = New ConditionValue(ConditionValueType.LowestValue, "0") 但它给出了一个错误:没有定义ConditionalValue 我有以下进口产品:
sheet.Range("F3").FormatConditions.AddDatabar()
如何添加:
明点
MaxPoint
巴色
我试过:
sheet.Range("F3").FormatConditions(1).MinPoint = New ConditionValue(ConditionValueType.LowestValue, "0")
但它给出了一个错误:没有定义ConditionalValue
我有以下进口产品:
Imports Excel = Microsoft.Office.Interop.Excel
我很困惑,因为我是VB.NET的新手!!
请帮忙 您可以在Microsoft网站上找到有关如何设置和如何设置的重要信息 在第二个链接上,您可以找到如何创建数据库和设置最小/最大点:
'Create a data bar with default behavior.
Set cfDataBar = Selection.FormatConditions.AddDatabar
MsgBox "Because of the extreme values, the middle bars are very similar"
'The MinPoint and MaxPoint properties return a ConditionValue object
'that you can use to change the threshold parameters.
cfDataBar.MinPoint.Modify newtype:=xlConditionValuePercentile, _
newvalue:=5
cfDataBar.MaxPoint.Modify newtype:=xlConditionValuePercentile, _
newvalue:=75
希望有帮助
问候,马克斯嗯,那没用。。因为它更像是一种VB脚本类型的语法。但这解决了问题。。正如我从中得到的暗示!对不起,我对VB.Net了解不够,但我很高兴它解决了您的问题