|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub 查找替换()
Dim ar As Variant
Dim rn As Range
With Sheet1
r = .Cells(Rows.Count, 1).End(xlUp).Row
ar = .Range("a1:c" & r)
End With
For i = 2 To UBound(ar)
If Trim(ar(i, 1)) <> "" Then
For Each sh In Sheets
If sh.Index > 1 Then
rs = sh.Cells(Rows.Count, 1).End(xlUp).Row
Set rn = sh.Range("b5:f" & rs).Find(ar(i, 1), , , , , , 1)
If Not rn Is Nothing Then
h = rn.Column
If h = 2 Then
x = rn.Row
y = sh.Cells(x, Columns.Count).End(xlToLeft).Column + 1
sh.Cells(x, 11) = ar(i, 2)
sh.Cells(x, 11).Interior.ColorIndex = Sheet1.Cells(i, 2).Interior.ColorIndex
sh.Cells(x, y) = ar(i, 3)
sh.Cells(x, y).Interior.ColorIndex = Sheet1.Cells(i, 3).Interior.ColorIndex
End If
End If
End If
Next sh
End If
Next i
MsgBox "ok!"
End Sub
|
评分
-
1
查看全部评分
-
|