使用2种不同的XLFormatConditionType访问VBA-条件格式
我想在从access导出到excel时设置条件格式。我必须检查条件1(类型:=xlExpression)和条件2(类型:=xlTextString)。如果两者都为真,则在excel中用任何颜色高亮显示该行。这是我的密码:使用2种不同的XLFormatConditionType访问VBA-条件格式,vba,excel,Vba,Excel,我想在从access导出到excel时设置条件格式。我必须检查条件1(类型:=xlExpression)和条件2(类型:=xlTextString)。如果两者都为真,则在excel中用任何颜色高亮显示该行。这是我的密码: With xlSheet Set range = .Range("A1:L1") Sheets("xyz").Select range.FormatConditions.Add Type:=xlExpression, Formula1:="=AND(
With xlSheet
Set range = .Range("A1:L1")
Sheets("xyz").Select
range.FormatConditions.Add Type:=xlExpression, Formula1:="=AND($I1>=TODAY(),($I1<(TODAY()+30)))"
rng.FormatConditions.Add Type:=xlTextString, String:="Focus", TextOperator:=xlContains
With rng.FormatConditions(1).Interior
.Color = Any color
End With
End With
带xlSheet
设置范围=.range(“A1:L1”)
图纸(“xyz”)。选择
range.FormatConditions.Add Type:=xlExpression,Formula1:=“=和($I1>=TODAY(),($I1您文章中的代码在某些方面有点凌乱,因此我对修复的假设可能有点偏离。但是,这些东西您可能很容易调整
至于组合这些条件,只需在当前表达式的和包装器中放置另一个公式即可
With xlSheet
Set range = .Range("A1:L1")
range.FormatConditions.Add Type:=xlExpression, Formula1:="=AND($I1>=TODAY(),($I1<(TODAY()+30),NOT(ISERROR(FIND(""Focus"",$I1))))"
With range.FormatConditions(1).Interior
.Color = Any color
End With
End With
带xlSheet
设置范围=.range(“A1:L1”)
range.FormatConditions.Add Type:=xlExpression,Formula1:=“=和($I1>=TODAY(),($I1您文章中的代码在某些方面有点凌乱,因此我对修复的假设可能有点偏离。但是,这些东西您可能很容易调整
至于组合这些条件,只需在当前表达式的和包装器中放置另一个公式即可
With xlSheet
Set range = .Range("A1:L1")
range.FormatConditions.Add Type:=xlExpression, Formula1:="=AND($I1>=TODAY(),($I1<(TODAY()+30),NOT(ISERROR(FIND(""Focus"",$I1))))"
With range.FormatConditions(1).Interior
.Color = Any color
End With
End With
带xlSheet
设置范围=.range(“A1:L1”)
range.FormatConditions.Add Type:=Xexpression,Formula1:=“=和($I1>=TODAY(),($I1Hi Scott,你能帮我解决这个问题吗..嗨Scott,你能帮我解决这个问题吗。。