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

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

 

posted @ 2020-03-20 12:43  Sundance8866  阅读(200)  评论(0编辑  收藏  举报