Delete Duplicates in One Column in Excel after Access Export

JMarcus

Registered User.
Local time
Yesterday, 22:22
Joined
Mar 30, 2016
Messages
89
Does anyone know how to delete the duplicates in one column once opening the data query in excel?

Here is my code:

Private Sub Command56_Click()
Dim strFile As String
Dim objXL As Object
Dim objWB As Object
strFile = CurrentProject.Path & "\Test.xlsx"
If Len(Dir(strFile)) > 0 Then
Kill strFile
End If
DoCmd.TransferSpreadsheet acExport, 10, _
"qryHere", CurrentProject.Path & "\Test.xlsx", True

Set objXL = CreateObject("Excel.Application")
objXL.Visible = True
Set objWB = objXL.Workbooks.Open(strFile)
objXL.UserControl = True
Set objXL = Nothing
strFile = CurrentProject.Path & "\Test.xlsx"
MsgBox "Data export completed", vbInformation, "Completed"
End Sub
 
delete the duplicate record?
or the duplicate field?
 
duplicate records
 

Users who are viewing this thread

Back
Top Bottom