The Macro  is not working.

On Fri, Sep 4, 2009 at 3:50 AM, Harmeet Singh <harmeet.hew...@gmail.com>wrote:

> *a quick solution.....see attached file............*
>
> On Thu, Sep 3, 2009 at 6:10 PM, Paul Schreiner <schreiner_p...@att.net>wrote:
>
>>  I created a macro called Gen_IDs()
>>
>> run it and it generates your summary on sheet: Summary.
>>
>> the macro looks like:
>>
>>
>> Option Explicit
>> Sub Gen_IDs()
>>     Dim Dict_Key
>>     Dim rowcnt, R, I, KeyArray, IDarray
>>     rowcnt =
>> Application.WorksheetFunction.CountA(ThisWorkbook.Sheets("DATA").Range("A1:A65000"))
>>     Set Dict_Key = CreateObject("Scripting.Dictionary")
>>     Dict_Key.RemoveAll
>>     For R = 2 To rowcnt
>>         If ((ThisWorkbook.Sheets("DATA").Cells(R, 1).Value <> "") _
>>         And (ThisWorkbook.Sheets("DATA").Cells(R, 2).Value <> "")) Then
>>             If (Not Dict_Key.exists(ThisWorkbook.Sheets("DATA").Cells(R,
>> 1).Value)) Then
>>                 Dict_Key.Add ThisWorkbook.Sheets("DATA").Cells(R,
>> 1).Value, ThisWorkbook.Sheets("DATA").Cells(R, 2).Value
>>             Else
>>                 Dict_Key.Item(ThisWorkbook.Sheets("DATA").Cells(R,
>> 1).Value) = _
>>                 Dict_Key.Item(ThisWorkbook.Sheets("DATA").Cells(R,
>> 1).Value) & "|" _
>>                             & ThisWorkbook.Sheets("DATA").Cells(R,
>> 2).Value
>>             End If
>>         End If
>>     Next R
>>     ThisWorkbook.Sheets("Summary").Range("A1:Z65000").ClearContents
>>     ThisWorkbook.Sheets("Summary").Range("A1") = "KEY"
>>     KeyArray = Dict_Key.keys
>>     For R = 0 To Dict_Key.Count - 1
>>         ThisWorkbook.Sheets("Summary").Cells(R + 2, 1) = KeyArray(R)
>> 'Dict_Key.Item(KeyArray(R))
>>         ReDim IDarray(1)
>>         IDarray = Split(Dict_Key.Item(KeyArray(R)), "|")
>>         For I = 0 To UBound(IDarray)
>>             If (ThisWorkbook.Sheets("Summary").Cells(1, I + 2).Value = "")
>> Then ThisWorkbook.Sheets("Summary").Cells(1, I + 2).Value = "ID"
>>             ThisWorkbook.Sheets("Summary").Cells(R + 2, I + 2) =
>> IDarray(I)
>>         Next I
>>     Next R
>> End Sub
>>
>> hope this helps
>>
>> Paul
>>
>>  ------------------------------
>> *From:* madhur baharani <madhur.bahar...@gmail.com>
>> *To:* excel-macros@googlegroups.com
>> *Sent:* Thursday, September 3, 2009 7:12:34 AM
>> *Subject:* $$Excel-Macros$$ Re: NEED HELP on multiple vlookup
>>
>> Hi Rahul,
>>
>>            Their are different ID's which are associated with the same key
>> value as mentioned below :-
>>
>>
>>
>> *KEY*
>>
>> *ID*
>>
>> 116ABC1000
>>
>> 4223
>>
>> 116ABC1000
>>
>> 2857
>>
>> 1349ABC1002
>>
>> 1262
>>
>> 1349ABC1002
>>
>> 5045
>>
>> 1349ABC1002
>>
>> 5135
>>
>> 96ABC1013
>>
>> 2801
>>
>> 96ABC1013
>>
>> 6294
>>
>>
>>
>> for ex 1262, 5045, 5135 are all associated with only 1349ABC1002.
>>
>> So i need to get all these ID's against the KEY value as follows :-
>>
>>
>>
>> *KEY*
>>
>> *ID_1*
>>
>> *ID_2*
>>
>> *ID_3*
>>
>> 1349ABC1002
>>
>> 1262
>>
>> 5045
>>
>> 5135
>>
>>
>>
>> I need this solution for the entire data as mentioned in DATA sheet in the
>> workbook.
>>
>> Thanks for your quick response.
>>
>> On Thu, Sep 3, 2009 at 12:48 PM, rahul rahul 
>> <rahulmakhar...@yahoo.co.in>wrote:
>>
>>>
>>>
>>> Hi Madhur,
>>>
>>> What you may wanna do is to run a pivot on the data sheet to see how many
>>> ID's does a Key actually have an there by extract the data from the same.
>>>
>>> Regards,
>>> Rahul
>>>
>>>
>>>
>>> --- On Thu, 3/9/09, madhur baharani <madhur.bahar...@gmail.com> wrote:
>>>
>>> > From: madhur baharani <madhur.bahar...@gmail.com>
>>> > Subject: $$Excel-Macros$$ NEED HELP on multiple vlookup
>>> > To: excel-macros@googlegroups.com
>>> > Date: Thursday, 3 September, 2009, 12:28 PM
>>> > Dear All,
>>> >              I need your help.
>>> > Kindly find the attached data sheet, query & the
>>> > solution which i need is explained in it.
>>> > Please help me on the issue since i have to invest a lot of
>>> > time in solving it.
>>> >
>>> >
>>> > Thanks in advance.
>>> >
>>> >
>>> > -- --
>>> > Thanks & Regards,
>>> > Madhur Baharani
>>> > OSS Kolkata
>>> > Mob: 91-9874459054
>>> > Mob: 91-9831804654
>>> >
>>> >
>>> > >
>>> >
>>> >
>>> >
>>>
>>>
>>>      Love Cricket? Check out live scores, photos, video highlights and
>>> more. Click here http://cricket.yahoo.com
>>>
>>>
>>>
>>
>>
>> --
>> -- --
>> Thanks & Regards,
>> Madhur Baharani
>> OSS Kolkata
>> Mob: 91-9874459054
>> Mob: 91-9831804654
>>
>>
>>
>>
>>
>>
>
>
> --
> Thanks & Regards,
>
> Harmeet Singh
>
> Sent via BlackBerry Wireless
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
----------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 5,200 subscribers worldwide and receive many nice notes about the 
learning and support from the group. Our goal is to have 10,000 subscribers by 
the end of 2009. Let friends and co-workers know they can subscribe to group at 
http://groups.google.com/group/excel-macros/subscribe
-~----------~----~----~----~------~----~------~--~---

Reply via email to