|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
比如,下面这段代码中的B1:B105如何变成任意一个工作表的B1到B的非空最大值呢?感谢!
Dim i%
For i = 3 To Worksheets.Count
Sheets(i).Activate
Range("B1").Select
ActiveCell.FormulaR1C1 = "."
Selection.AutoFill Destination:=Range("B1:B105"), Type:=xlFillDefault
Range("B1:B105").Select
ActiveWindow.SmallScroll Down:=-102
Range("C1").Select
ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[-2],RC[-1])"
Range("C1").Select
Selection.AutoFill Destination:=Range("C1:C105")
Range("C1:C105").Select
ActiveWindow.SmallScroll Down:=-24
Columns("C:C").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("B:C").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Next
End Sub
|
|