Shereen Shousha
New Member
- Joined
- Dec 12, 2017
- Messages
- 3
Hi all, i'm new to VBA so I do need some help. I'm trying to create some macros to help me accelerating my repeatable steps in my workbook. I have just got the way to correct the duplication when it occur but I hope you can help me to find a way to prevent it from happening. Here is the details to my macro. thanks
Sub Copy_Data()
'
' Copy_Data Macro
'
'
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Copy
Workbooks.Open Filename:="C:\Users\Said\Documents\Dubai VBA\VBA\Orders.xlsx" _
, Origin:=xlWindows
Range("A1").Select
Selection.End(xlDown).Select
'Range("A3267").Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.CurrentRegion.RemoveDuplicates Columns:=Array(1, 2, 3, 4, 5, 6, _
7), Header:=xlNo
ActiveWindow.Close savechanges:=True
Application.CutCopyMode = False
Range("A1").Select
End Sub
Sub Copy_Data()
'
' Copy_Data Macro
'
'
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Copy
Workbooks.Open Filename:="C:\Users\Said\Documents\Dubai VBA\VBA\Orders.xlsx" _
, Origin:=xlWindows
Range("A1").Select
Selection.End(xlDown).Select
'Range("A3267").Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.CurrentRegion.RemoveDuplicates Columns:=Array(1, 2, 3, 4, 5, 6, _
7), Header:=xlNo
ActiveWindow.Close savechanges:=True
Application.CutCopyMode = False
Range("A1").Select
End Sub