Filter Unique and delete Duplicates

bayyari

New Member
Joined
Oct 10, 2009
Messages
6
Ok, I have this form that I have been working on. It is a submission form for numbers that are submitted to certain sheets depending on where it needs to go. So for now, my code just checks for a number input, copies from sheet Form and pastes into the new field in one of the other sheets, then deletes the input text in the original form. I am wanting it to copy over and check for duplicates in column B where the unique data is supposed to be and delete the duplicates. So far i have looked up several pieces of macro code that doesn't work, except for altering the look of my spreadsheet. So, for an idea of how my sheet looks:

(INPUT BOX) -> Button


when you click the button it sends the info to sheet 2 and pastes in this format:

ColA ColB
*DATE* *NUMBER*

cells A1 and B1 have names so they do not necessarily need to be included.

After it pastes it clears the original cell the data came from. Here is the code i have.

Code:
Sub rrmacro()

'
    Sheets("Form").Select

   For Each x In Range("C6")
     If x = 0 Then varAnswer = MsgBox("Ticket number is needed", vbOKOnly, "Alert")
     If x >= "1" Then Sheets("Form").Range("C6,A6") _
     .Copy Sheets("RR").Cells(Rows.Count, _
     1).End(xlUp).Offset(1, 0)
     Range("C6").Select
    Selection.ClearContents
   
    Next
End Sub
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Recodr a macro doing this using Advanced Filter. this will give you the syntax. It will be somethibng like this
Code:
Sheets("Sheet1").Range("D1:D9").AdvancedFilter Action:=xlFilterCopy, _
        CopyToRange:=Range("C1"), Unique:=True

lenze
 
Upvote 0
Thanks! I actually did this after i submitted the question and it now works. I was just trying to figure out a way to keep it from switching screens. But thats ok, it's just for work and i'm sure they won't care.
 
Upvote 0

Forum statistics

Threads
1,216,077
Messages
6,128,685
Members
449,463
Latest member
Jojomen56

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