1
我需要突出显示单元格:如果已经强调然后在另一个细胞数找到并强调VBA细胞突出
这是我非常基本的代码。
它的工作原理,但我发现,如果我有相同数目的多个它仍然只会突出显示第一次发现。我需要它能够说明它已经突出显示并转到下一个并突出显示。
Sub Find_FirstmanUALDar()
Dim FindString8 As String
Dim Rng8 As Range
FindString8 = Sheets("DAR").Range("D12").Value
If Trim(FindString1) <> "" Then
With Sheets("GL").Range("AC:AC")
Set Rng8 = .Find(What:=FindString8, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng8 Is Nothing Then
Application.Goto Rng8, True
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
End With
我知道它的丑陋,但请大家帮忙。 谢谢
+1虽然我也喜欢'Loop While'而不是如果测试退出循环:) – brettdj