|
Sub 每天()
Dim r%, i%
Dim arr, brr
Dim d As Object
Set d = CreateObject("scripting.dictionary")
ts = Application.InputBox(prompt:="请输入相隔天数", Title:="操作提示", Default:=0, Type:=1)
With ActiveSheet
r = .Cells(.Rows.Count, 1).End(xlUp).Row
.Range("c3:v" & r).Interior.Color = 16772537
arr = .Range("c3:v" & r)
ReDim brr(1 To UBound(arr), 1 To UBound(arr, 2))
For i = 1 To UBound(arr) - ts - 1
d.RemoveAll
For j = 1 To UBound(arr, 2)
d(arr(i + ts + 1, j)) = Empty
Next
n = 0
For j = 1 To UBound(arr, 2)
If d.exists(arr(i, j)) Then
.Cells(i + 2, j + 2).Interior.ColorIndex = 3
n = n + 1
brr(i, n) = j
End If
Next
Next
.Range("x3").Resize(UBound(brr), UBound(brr, 2)) = brr
End With
Sheets(" 0 ").Select
Range("Y1:AT20").Select
Selection.Copy
Windows("能定(1).xlsm").Activate
Dim searchRange As Range
Set searchRange = Range("AG2536:AG2538")
Dim findValue As Variant
findValue = "999"
Dim resultCell As Range
Set resultCell = searchRange.Find(findValue)
resultCell.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlPasteSpecialOperationNone, SkipBlanks:=False, Transpose:=False
End Sub
|
|