复制,删除 选中单元格对应的行

Sub RowCopy()
Dim rngNew As Range
Dim rngUpdate As Range
     Set rngNew = Application.InputBox("Select the range you want to copy from", , , , , , , 8)
     Set rngUpdate = Application.InputBox("Select the range you want to paste in", , , , , , , 8)
     rngUpdate.Parent.Parent.Activate
     rngUpdate.Parent.Select
     rngUpdate.Select
     rngNew.EntireRow.Copy
     ActiveSheet.Paste
MsgBox "OK"
End Sub
Sub deleteRows()
Dim rngTem As Range
Dim rngNew As Range
'     MsgBox Selection.Row
     Set rngNew = Application.InputBox("Select the range you want to copy from", "Select", , , , , , 8)
     ActiveSheet.Select
'     rngNew.EntireRow.Select
     rngNew.EntireRow.Delete
'MsgBox "OK"
End Sub

猜你喜欢

转载自www.cnblogs.com/sundanceS/p/12530960.html