2011-06-30 105 views
0

私の範囲にBarType条件付き書式を追加したい!VB.netでExcelで条件付き書式設定(BarType)

私が持っている:

sheet.Range("F3").FormatConditions.AddDatabar() 

どのように追加する: MinPoint MaxPoint BarColor を???

私が試した:

sheet.Range("F3").FormatConditions(1).MinPoint = New ConditionValue(ConditionValueType.LowestValue, "0") 

をしかし、それはエラーを与える:ConditionalValueが定義されていません...?

私が輸入を次ています

Imports Excel = Microsoft.Office.Interop.Excel 

私はVB.NETに新しいですので、私は、混乱しています!! 助けてください!!

答えて

0

condtional formating with VB.netの設定方法とdata bar conditional formatingの設定方法については、マイクロソフトのWebサイトを参照してください。あなたがデータバーおよび設定最小/最大ポイントを作成する方法を見つけることができ、第2リンク、オン

'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 

希望、まあ

よろしく、
マックス

+0

のdidnことができますそれはVB Script型の構文のほうが多かったので働いていませんでした。 しかし、これは問題を解決しました。私はこれからヒントを得ました! –

+0

申し訳ありませんが、VB.NetはVBSと比較しても十分分かりませんが、問題が解決してうれしいです – JMax

関連する問題