試圖經由VBA應用條件格式到電子表格,將有25K +行。沒有設置最後一列或最後一行,因此由於某種原因難以應用下面的代碼。當我檢查每行的條件格式時,它始終指向第3行。如果我把RC」 & LASTCOL +3 &‘= FALSE’它認識到這一點,例如細胞RC25:條件格式與xlR1C1式
Range(Cells(3, FoundCol), Cells(lastrowRecon, FoundCol)).Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=R[]C" & lastCol + 3 & "=FALSE"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
End With
在R1C1風格RC25意味着欄Y與公式單元格行。所以如果你在A1中使用= RC25,這意味着xlA1風格,它相當於$ Y1。 – sktneer
@sktneer - 只有當'Application.ReferenceStyle = xlR1C1'。如果'Application.ReferenceStyle = xlA1'然後'= RC25'表示471列,行25 – Jeeped
呀絕對正確的。我只是在討論問題標題的參考。 – sktneer