formula or macro?

bigK

New Member
Joined
Aug 7, 2007
Messages
49
I'm trying to populate a worksheet (column A) with part numbers from a previous worksheet the only problem i have is that on the original there are multiples of the same thing and i want to only show one of them (if there are multiple)

would a formula or a macro be best for this ... and what form would either a formula or macro take

cheers
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
i would use VBA

Code:
Sub DeleteDups() 
     
    Dim x               As Long 
    Dim LastRow         As Long 
     
    LastRow = Range("A65536").End(xlUp).Row 
    For x = LastRow To 1 Step -1 
        If Application.WorksheetFunction.CountIf(Range("A1:A" & x), Range("A" & x).Text) > 1 Then 
            Range("A" & x).EntireRow.Delete 
        End If 
    Next x 
     
End Sub

you want to get rid of duplicates in column A correct?
 
Upvote 0
I'm trying to populate a worksheet (column A) with part numbers from a previous worksheet the only problem i have is that on the original there are multiples of the same thing and i want to only show one of them (if there are multiple)

would a formula or a macro be best for this ... and what form would either a formula or macro take

cheers

Run Data|Filter|Advanced Filter on the data from within the destination sheet with "Unique records only" checked...
 
Upvote 0
I'm trying to populate a worksheet (column A) with part numbers from a previous worksheet the only problem i have is that on the original there are multiples of the same thing and i want to only show one of them (if there are multiple)

would a formula or a macro be best for this ... and what form would either a formula or macro take

cheers

Run Data|Filter|Advanced Filter on the data from within the destination sheet with "Unique records only" checked...

that works too, only that doesn't delete them

easier for you if your not familiar with code though
 
Upvote 0

Forum statistics

Threads
1,214,378
Messages
6,119,188
Members
448,873
Latest member
jacksonashleigh99

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