Still finding the necessity  for the lengthiest code from prince.
It can be achieved in few clicks through excel built in option called
"Remove Duplicates".
Assuming OP is using excel 2007 or later versions as he is working with 6
lakh records.
The below code is enough, even if we want to write in vba

Sub duplicates()
Range("a1", Range("a1").End(xlDown)).Select
Selection.RemoveDuplicates Columns:=Array(1), Header:=xlYes
End Sub



On Fri, Jan 4, 2013 at 5:33 PM, Anoop K Sharma <aks.sharm...@gmail.com>wrote:

> You're great dude.
>
>
> On Fri, Jan 4, 2013 at 5:31 PM, Prince <prince141...@gmail.com> wrote:
>
>> most welcome dear.
>>
>> regards
>> prince
>>
>>
>> On Friday, January 4, 2013 5:08:01 PM UTC+5:30, amar takale wrote:
>>
>>>
>>> Thank Very much...............Prince
>>>
>>>
>>> On Fri, Jan 4, 2013 at 4:37 PM, Prince <prince...@gmail.com> wrote:
>>>
>>>> Public Sub removeDuplicateId()
>>>>
>>>>     Dim vardata     As Variant
>>>>     Dim varRes      As Variant
>>>>     Dim lngRow      As Long
>>>>     Dim objDic      As Object
>>>>
>>>>
>>>>     Set objDic = CreateObject("Scripting.**Dictionary")
>>>>
>>>>     With ThisWorkbook.Worksheets("**Sheet1")
>>>>         vardata = Application.WorksheetFunction.**
>>>> Transpose(Intersect(.Range("**A1").CurrentRegion,
>>>> .Range("A1").CurrentRegion.**Offset(1)))
>>>>         For lngRow = LBound(vardata) To UBound(vardata)
>>>>             If objDic.exists(vardata(lngRow)) = False Then
>>>>                 objDic.Add vardata(lngRow), vardata(lngRow)
>>>>             End If
>>>>         Next
>>>>         varRes = Application.WorksheetFunction.**
>>>> Transpose(objDic.items)
>>>>         .Range("B2").Resize(UBound(**varRes), 1) = varRes
>>>>     End With
>>>>
>>>> End Sub
>>>>
>>>
>>>  --
>> Join official Facebook page of this forum @
>> https://www.facebook.com/discussexcel
>>
>> FORUM RULES
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will not get quick attention or may not be answered.
>> 2) Don't post a question in the thread of another member.
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>> 4) Acknowledge the responses you receive, good or bad.
>> 5) Jobs posting is not allowed.
>> 6) Sharing copyrighted material and their links is not allowed.
>>
>> NOTE : Don't ever post confidential data in a workbook. Forum owners and
>> members are not responsible for any loss.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "MS EXCEL AND VBA MACROS" group.
>> To post to this group, send email to excel-macros@googlegroups.com.
>> To unsubscribe from this group, send email to
>> excel-macros+unsubscr...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/excel-macros?hl=en.
>>
>>
>>
>
>
>
> --
> Regards,
> Anoop
> Sr. Developer
>
> --
> Join official Facebook page of this forum @
> https://www.facebook.com/discussexcel
>
> FORUM RULES
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
> 2) Don't post a question in the thread of another member.
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
> 4) Acknowledge the responses you receive, good or bad.
> 5) Jobs posting is not allowed.
> 6) Sharing copyrighted material and their links is not allowed.
>
> NOTE : Don't ever post confidential data in a workbook. Forum owners and
> members are not responsible for any loss.
> ---
> You received this message because you are subscribed to the Google Groups
> "MS EXCEL AND VBA MACROS" group.
> To post to this group, send email to excel-macros@googlegroups.com.
> To unsubscribe from this group, send email to
> excel-macros+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/excel-macros?hl=en.
>
>
>

-- 
Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To post to this group, send email to excel-macros@googlegroups.com.
To unsubscribe from this group, send email to 
excel-macros+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros?hl=en.


Reply via email to