abdelfattah
Well-known Member
- Joined
- May 3, 2019
- Messages
- 1,429
- Office Version
- 2019
- 2010
- Platform
- Windows
hello
i have this code copy specific rows from sheet to another but when i copy again it delete the old it replace of it the new i would add under old data and if data already is existed then ignore them and show me message ""data is duplicated you can't copy"
thanks
i have this code copy specific rows from sheet to another but when i copy again it delete the old it replace of it the new i would add under old data and if data already is existed then ignore them and show me message ""data is duplicated you can't copy"
VBA Code:
Sub Sample()
Dim rngCopyFrom As Range
On Error Resume Next
Set rngCopyFrom = Application.InputBox("Enter the range from which you want to copy", Type:=8)
On Error GoTo 0
If Not rngCopyFrom Is Nothing Then
rngCopyFrom.Activate
rngCopyFrom.Copy ThisWorkbook.Sheets("sheet2").Range("A1")
End If
End Sub
thanks