|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub test()
- Dim ar, i&, wks As Worksheet
- For Each wks In Worksheets
- If wks.Name Like "*数据源*" And wks.[A1] <> "序号" Then
- With Range(wks.[A1], wks.Cells(Rows.Count, "A").End(3))
- .EntireColumn.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
- ar = .Value
- ar(1, 1) = "序号"
- For i = 2 To UBound(ar)
- ar(i, 1) = i - 1
- Next
- End With
- wks.[A1].Resize(UBound(ar)) = ar
- wks.Cells(1, Columns.Count).End(xlToLeft).Offset(0, 1) = "核对结果"
- End If
- Next
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|