How to prevent duplicating the same data for VBA

snorlax

New Member
Joined
Jan 17, 2018
Messages
2
Hi,

i'm really new to VBA. i would like to know what should i do for my VBA files if i want to prevent any duplicating data in future. What commands should i use in the macro? for example if i'm doing monthly update data.

tq.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi,

Duplicates in what exactly, as data covers all manner of things. If you can explain a little bit more, I'm sure there will plenty of help for you.
 
Upvote 0
i have this macro:

Sub append_data()
'
' append_data Macro
'


'
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Selection.CurrentRegion.Select
Selection.Copy
Workbooks.Open Filename:="C:\Users\IED\Documents\VBA_KL\VBA\Orders.xlsx"
Range("A1").Select
Selection.End(xlDown).Select
' Range("A3267").Select
ActiveCell.Offset(1, 0).Range("A1").Select
Windows("Orders.xlsx").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

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

i want to remove any duplicates in the data files before i save the macro
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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