|
楼主 |
发表于 2023-2-13 09:48
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
老师,你代码里这一段是啥意思呀
For Each ws In Worksheets
If ws.Name <> "summary" And ws.Name <> "note" And ws.Name <> "info" Then
With ws
r = .UsedRange.Find(what:="*", LookIn:=xlValues, lookat:=xlWhole, searchorder:=xlByRows, searchdirection:=xlPrevious).Row
c = .UsedRange.Find(what:="*", LookIn:=xlValues, lookat:=xlWhole, searchorder:=xlByColumns, searchdirection:=xlPrevious).Column
arr = .Range("a1").Resize(r, c)
ls = .Range("b3").MergeArea.Columns.Count
m = 0
For i = 3 To r
If .Cells(i, 2).MergeCells And .Cells(i + 1, 2).MergeCells Then
m = m + 1
ReDim Preserve zrr(1 To m)
zrr(m) = Array(i, i)
Else
If m > 0 Then
zrr(m)(1) = i
End If
End If
Next
特别是
m = 0
For i = 3 To r
If .Cells(i, 2).MergeCells And .Cells(i + 1, 2).MergeCells Then
m = m + 1
ReDim Preserve zrr(1 To m)
zrr(m) = Array(i, i)
Else
If m > 0 Then
zrr(m)(1) = i
End If
End If
Next
m是指什么? |
|