|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub tt()
- Dim ar, b2, b3, i%, j%
- Dim d As Object
- Set d = CreateObject("scripting.dictionary")
- With Sheet1
- ar = .[a4].CurrentRegion
- b2 = .[j3].CurrentRegion
- b3 = .[m3].CurrentRegion
- For i = 3 To UBound(b2)
- d(b2(i, 2)) = b2(i, 1)
- Next i
- For i = 3 To UBound(b3)
- For j = 1 To UBound(b3, 2) Step 3
- If b3(i, j) <> "" Then
- d(b3(i, j)) = b3(i, j + 1)
- End If
- Next j
- Next i
- For i = 2 To UBound(ar)
- If InStr(ar(i, 1), "单位") Then
- t = Split(ar(i, 1), ":")(1)
- ar(i, 1) = "单位名称:" & d(CInt(t))
- End If
- For j = 2 To UBound(ar, 2)
- If IsNumeric(ar(i, j)) Then
- t = ar(i, j)
- End If
- If d.exists(ar(i, j)) Then
- ar(i, j) = d(t)
- End If
- Next j
- Next i
- .[a31].Resize(UBound(ar), UBound(ar, 2)) = ar
- End With
- Set d = Nothing
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|