1
下面的代碼在我的工作簿的不同工作表中搜索重複項。問題是它需要一點時間才能完成。如何在底部的狀態欄中添加進度指示器?Excel/VBA /添加進度條
謝謝&親切的問候。
Sub dup()
Dim cell As Range
Dim cella As Range
Dim rng As Range
Dim srng As Range
Dim rng2 As Range
Dim SheetName As Variant
Application.ScreenUpdating = False
Worksheets("Screener").Range("A7:A15").Interior.ColorIndex = xlNone
Columns("B:B").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Set srng = Sheets("Screener").Range("A7:A2000")
Set rng = Sheets("Rejected").Range("A7:A2000")
Set rng2 = Sheets("Full Data").Range("A7:A2000")
For Each cell In rng
For Each cella In srng
If cella = cell Then
cella.Interior.ColorIndex = 4
cella.Offset(, 1) = "Rejected"
End If
Next cella
Next cell
For Each cell In rng2
For Each cella In srng
If cella = cell Then
cella.Interior.ColorIndex = 5.5
cella.Offset(, 1) = "Reported"
End If
Next cella
Next cell
Application.ScreenUpdating = True
End Sub
謝謝你的快速回復,其工作很好。有沒有辦法省略範圍內的空白單元格?乾杯! – Ocean8
嗨海洋!我已經改變了我的代碼,所以它會跳過'Screener'工作表中任何空白的單元格,這是你的意思嗎? –
如果這對你有用,你可以按照接受的答案打勾,歡呼! –