VBA duplicates and range

Status
Not open for further replies.

3badi

New Member
Joined
Apr 23, 2019
Messages
5
Hi
Please help with the following

Sub append_data()
'
' append_data Macro
'


'
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Selection.CurrentRegion.Select
Selection.Copy
Workbooks.Open Filename:= _
"C:\Users\abdullah.alzadjali\Documents\Oman VBA\VBA\Orders.xlsx"
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.Select
Selection.CurrentRegion.Select
Selection.CurrentRegion.Select
ActiveSheet.Range("A1").CurrentRegion.RemoveDuplicates Columns:=Array(1, 2, 3, 4, 5, 6, _
7), Header:=xlYes

ActiveWindow.Close savechanges:=True
Application.CutCopyMode = False
Range("A1").Select
End Sub

I want to know what is wrong with the bold area I am trying to make it remove the duplicates and fit with any range. Please I am new in using VBA

Thanks
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,226,693
Messages
6,192,468
Members
453,726
Latest member
JoeH57

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top