|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub 增加行()
ActiveSheet.Unprotect ("123")
With ActiveSheet
Set Rng = .Columns(1).Find("合 计", , , 1)
If Not Rng Is Nothing Then
rs = Rng.Row
.Rows(rs & ":" & rs + 9).Insert Shift:=xlDown
.Range(.Cells(rs - 1, "f"), .Cells(rs - 1, "i")).AutoFill Destination:=.Range(.Cells(rs - 1, "f"), .Cells(rs + 9, "i")), Type:=xlFillDefault
End If
k = ActiveSheet.Range("a65536").End(xlUp).Row - 1
For i = 3 To k
Range("a" & i) = i - 2
Next
End With
End Sub
密码:
Range("C2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select '
ActiveSheet.Protect Password:="123", DrawingObjects:=True, Contents:=True, Scenarios:=True
|
|