2
我需要有條件地格式化根據加載的數據左右移動的三列。條件是單元格值爲空(="")
。我真的很難找出這個問題。更改範圍的條件格式化
這裏是我的設置:
Sub Conditional_Format()
Dim ws2 As Worksheet
Dim lRow3 As Long, lCol3 As Long
Dim rng8 As Range, rng9 As Range
Set ws2 = Worksheets("Unfav GT500 Comments")
With ws2
lRow3 = .Range("A" & .Rows.Count).End(xlUp).Row
lCol3 = .Cells(3, .Columns.Count).End(xlToLeft).Column
Set rng8 = .Range(.Cells(4, lCol3 - 2), .Cells(lRow3 - 1, lCol3 - 1))
Set rng9 = .Range(.Cells(4, lCol3), .Cells(lRow3 - 1, lCol3))
End With
End Sub
首先,您錯過了'End With'。另外,你需要在'rng8'之前'Dim'。你的數據是什麼樣的?你在哪裏尋找空白的細胞?您的帖子似乎有點遺漏。 – BruceWayne
爲什麼你需要使用VBA?另外,我沒有看到CF的任何代碼行。你想完成什麼? – L42