+ Reply to Thread
Results 1 to 82 of 82

[URGENT HELP REQUIRED] Macro to group informtion together

  1. #1
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    [URGENT HELP REQUIRED] Macro to group informtion together

    Hi,

    Please refer to example spreadsheet attached.

    I am needing to create a list of unique profiles i.e profiles that contain the same holdings. Is it possible to create a macro that will give me this list. Profile 1 and Profile 4 are the same and Profile 2 and Profile 5 are the same. Is there a quicker way of being able to identify this as I have a list of 800 to work through.

    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Which are the columns to be used for the comparison? And how do you want the output to be displayed?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Do you wish the result like this? If not, could you tell how the result looks like

    Profile Name Code of Holdings Holding Name
    Profile 1 AAA Holding A
    Profile 1 BBB Holding B
    Profile 1 CCC Holding C
    Profile 2 DDD Holding D
    Profile 2 EEE Holding E
    Profile 2 FFF Holding F

  4. #4
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    I have no set way in which I need the result to appear. I just need to be able to show what Profiles have identical holdings. Coulmn B (Code of Holdings) are unique and can be used for comparison. Is it possible to list Profiles that contain Holding A, Holding B & Holding C? But, if I have several hundred different varities of what holdings a Profile might contain is it possible to type into somewhere what holdings I'm wanting to search for and list the Profiles they are included in? Any suggestions or help would be much appreciated.

    Thanks

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    It is your data and you know what format the data should look like. I think it would be easier if you could show us your desired result with the attached book. How do the data look after running a code?

  6. #6
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Here is an example of what I would like it to be like, but I dont know how easy it is to get it into this type of format. Is it possible to have a macro to arrange it the way I have it formatted on the spreadsheet?
    Attached Files Attached Files

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    How are the packages decided?

  8. #8
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    By 'packages' i mean grouping a specific set of holdings together and see what Profiles contain these holdings. This was just an idea of how the resluts could be formatted.

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Would AAA, BBB and CCC always belong to package 1 and the other entries in package 2?

  10. #10
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Yes it would

  11. #11
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi arlu1201,

    Have you had a chance to look at this?

  12. #12
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Why dont you put forward what will be pre-populated and what you want the macro to populate for you? Do you want the entire format to be created by the macro?

  13. #13
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Sorry, I think I'm explaining this poorly. I'll try again

    The orginal list is a shortened size of what my actual spreadsheet looks like. I have about 800 Profiles to look at - this list only contains 5. The problem I have found with my big list is that some Profiles are identical (by means of containg the same holdings) but differ from Profile Name. i.e. Profile 1 & Profile 4 are identical - they have the same holdings but different names.

    Is there a program or macro to use by which I can tell excel "search for everything in the list that contains specific holdings and tell me what Profiles use these holdings".

    I am just needing a way to get a list of Profiles that contain the same holdings.

  14. #14
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Is it possible to run a macro that will come up with a pop up menu. Within the pop up menu will give me the option of typing what holdings im looking for. From that it can search through the spreadsheet to give me a list of all profiles that contain the same holdings?

  15. #15
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi arlu120,

    Do you know a code that can do what I've posted above?

  16. #16
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Please do not bump so often. I will work on something for you shortly.

  17. #17
    Registered User
    Join Date
    12-06-2012
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    This is similar to what I'm looking for. Did you get an answer Eoghan? Would be really grateful for any help!

  18. #18
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi Arlette,

    I appreciate you may be busy with other things and have told me not to 'bump' you with messages so often but I'm desperate to find a solution to my problem above. It would be very helpful if you can try and help soon.

    Thanks,

    Eoghan

  19. #19
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Quote Originally Posted by eoghanmolloy View Post
    Is it possible to run a macro that will come up with a pop up menu. Within the pop up menu will give me the option of typing what holdings im looking for. From that it can search through the spreadsheet to give me a list of all profiles that contain the same holdings?
    Yes this is possible.

    P.S. - Regarding bumping, its fine if you bump the thread once every 12-15 hrs. It applies not only to me, but everyone here

  20. #20
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Try this code - In the inputbox, it does not matter if the user enters "Holding A" or "A". It will be taken care of.
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose Tools | Macro | Macros
    Select a macro in the list, and click the Run button

  21. #21
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi Arlette,

    Thats brilliant thanks. Is there a way to search for multiple holding rather than just one? There is not a specific amount of holdings I need to look for. So, is it possible to include in the macro a pop up box in which I can enter how many holdings i need to look for and from that abnother pop up box to appear in which i can type the holdings in. From this the macro can look through the spreadsheet and create a list in a Report tab like you've already done so.

    Thanks

  22. #22
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Try this code in "Workbook":

    Please Login or Register  to view this content.
    This will create a summary of all "Holding" in a seperate sheet called "Output"

    Thanks
    If solved kindly remember to mark Thread as solved.
    Click the small star icon at the bottom left of my post if this was useful.

  23. #23
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi Arlette,

    This is not really what im after. The first macro seems like its on the right line but I'm needing to list profiles which have the same underlying holdings. So for example, I could search for Profiles that contain holding a, holding b, and holding c and it would give me a list of Profile 1 and Profile 4.

  24. #24
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Ok, in this case, you can have one form or a sheet which contains some boxes where you can put in this criteria. The macro can then work based on those boxes.

  25. #25
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Yes that would work also. Can I use one of the macros above to do this?

  26. #26
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    No, we will need to re-create it a bit. Which option do you choose - form or extra sheet with boxes? Its better you decide and design the sheet and upload it and i can create the macro immediately for you.

  27. #27
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi Eoghan,

    Did you try the code in post #22? It may be on the lines of what you are looking at...

    Thanks.

  28. #28
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    I have attahced a updated spreadsheet. In the 'Holding Info' tab is where I can enter the holdings I am wanting to search and then reduce a reoprt tab similar to the one you created in your first macro? Is this possible?
    Attached Files Attached Files

  29. #29
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Try this code -
    Please Login or Register  to view this content.

  30. #30
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi Arlette,

    I tried the above code but I complile error appeared on the following line:

    , SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal

  31. #31
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    The error message is saying 'variable not defined' if that helps...

  32. #32
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Oops i am sorry, i didnt see that you are using excel 2003.

    Updated code -
    Please Login or Register  to view this content.
    Last edited by arlu1201; 12-07-2012 at 01:37 PM.

  33. #33
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    I got it so you want to "filter"your list depending on the holding code

    You can do it with the filtering option yet I soon give you the code to run

  34. #34
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    in sheet2 I highlighted where you can enter the holdings code
    after that if you press ctr R the matching records will appear below
    Attached Files Attached Files

  35. #35
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    there is now a run-time error 438 with the following code, stating 'object doesnt support this property or method':



    .Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlYes, OrderCustom:=1, MatchCase:= _
    False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal

  36. #36
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Change it to
    Please Login or Register  to view this content.

  37. #37
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi Arlette,

    Perfect. Is there a way to create a different worksheet when I type different information into the holding tab? Currently a 'Report' tab is created but when I change the search criteria it overwrites what was already there.

    Thanks

  38. #38
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Updated code -
    Please Login or Register  to view this content.

  39. #39
    Forum Contributor
    Join Date
    11-05-2012
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    107

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hello rcm,

    I tried your workbook. It works perfect with the examples provided in it.
    However i tried to enter a profile called ''Profil 6'' with the code ''NNN''. The results i obtain after running the macros contains profile 6 as well as other profiles with different codes...

  40. #40
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi Arlette,

    That's brilliant, thanks. I added Profile 5 which contained Holding A & Holding B and Profile 6 which contained Holding A & Holding B. When I used the macro Profile 1,4,5 and 6 appeared. Is there a way to change the coding so that it has to be an exact match i.e. Profile 5 & 6 would be the only ones to appear?

    Naja, I added 'Profile 6' to Cell A14 of 'Sheet1', 'NNN' to B14 and 'Holding N' to C14 and in the 'Holding Info' tab changed the search criteria to Holding N i.e. I inserted 'Holding N' into A2 and kept everything blank bar the column headers i.e. 'Holding 1', 'Holding 2', etc and using the macro Arlette provided it worked perfectly...

  41. #41
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi Arlette,

    I thought I would have been able to copy the macro you gave me into the format of the spreadsheet I'm using but can't! I've attached my spreadsheet of the format I will be using. When you have some time can you edit the macro to reflect the changes I have made in my spreadsheet.

    How is the macro set up to search? Is it possible to do it by the code rather than the fund name as there are some circumstances in which the fund names differ but codes are the same.

    Thanks
    Attached Files Attached Files
    Last edited by eoghanmolloy; 12-10-2012 at 06:14 AM.

  42. #42
    Forum Contributor
    Join Date
    11-05-2012
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    107

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hello Eogh,

    You mean the code that is in message 38? I used the excel file in message 34, is that correct?

  43. #43
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Yes, use the code in messgae 38. I haven't tried the method posted in messgae 34.

  44. #44
    Forum Contributor
    Join Date
    11-05-2012
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    107

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hello,

    I mean using the code on the excel workbook in message 34.
    On what excel workbook did you try it on?

  45. #45
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Use it on this spreadsheet
    Attached Files Attached Files

  46. #46
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi,

    See if a Pivot Table filter solution works better than VBA code. Look at the example.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  47. #47
    Forum Contributor
    Join Date
    11-05-2012
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    107

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Thank you Eogh

  48. #48
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi MarvinP, thanks for that. Is there a way to change the Pivot table to search for multiple code of holdings. i.e Profiles that contain AAA, BBB & CCC?

  49. #49
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    YES!

    Simply click on the dropdown filter on the pivot table, in cell F2 and click on the ones you want to show. See attached again.
    Attached Files Attached Files

  50. #50
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Eogh,

    Anything pending on this thread? If not, you can mark it solved - Thread Tools -> Mark thread as solved.

  51. #51
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hii Arlette,

    I don't think the method MarvinP has suggested will work well for the list I have. Could you anwer my query on message 41? You're macro seems to be the best way round it but I just need it formatted to what my spreadsheet looks like. I've posted an example spreadhseet on message 41 for your reference. Thanks

  52. #52
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    You should have uploaded a sample file which matches your original file, so that the code does not have to be changed.

    Nevertheless, here is the updated code -
    Please Login or Register  to view this content.
    Is it possible to do it by the code rather than the fund name as there are some circumstances in which the fund names differ but codes are the same.
    The macro had been designed to take into account the code itself.
    Last edited by arlu1201; 12-11-2012 at 06:22 AM.

  53. #53
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Thanks for that Arlette. I'm getting a bit confused now. It works perfectly on the examples I've used but when I copy and paste special the data I want to use into the template it comes up with an error when I run the macro:

    'Run-time error '13': Type mismatch - If .Range("AF" & I).Value = Worksheets("Holding Info").Cells(6, j).Value Then

    Does it matter with how many rows I am using in the spreadsheet? I currently have 3,145. It worked for when I used a smaller sample...
    Last edited by eoghanmolloy; 12-11-2012 at 07:36 AM.

  54. #54
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    No the rows dont matter. When you run the macro and it errors out, click debug. It will highlight the above line in yellow, which you have given. So when you hover the mouse over I in range("AF" & i).value, what value do you see for I? Similarly what value do you see for J in Worksheets("Holding Info").Cells(6, j).Value?

  55. #55
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    I=1246, j=1

  56. #56
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    I had a look at row 1246 and the code is '#N/A'...this is the first one that appears in the list. Could this be why?

  57. #57
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    It seems to be working fine now. I have 10 fields in which I can use to search underlying holdings. The macro is currently set up for 5. How can I change it for 10?

  58. #58
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Yes the N/A was creating the issue and causing a type mismatch error.

    There is nothing to change. It will work for any number of holdings.

  59. #59
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Is there a limit on how many Report worksheets can be created? It doesn't work when I'm trying to create Report 11. The error states - 'Run time error '1004': Cannot rename a sheet to the same name as another sheet, a referenced object library or a workbook referecned by VB.'

  60. #60
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Actually, the way i have coded it is it checks for the last digit in the previous sheets name. So it renames the current sheet as Result + adds 1 to the last digit of the previous sheet name. So hence, the name appears as Result1 and not Result11. I thought of this method since i didnt expect you to have more than 10 results.

  61. #61
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Is there a way of changing the coding so that I can have more than 10 reports?

  62. #62
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Let me work it out.

  63. #63
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Updated code -
    Please Login or Register  to view this content.
    Last edited by arlu1201; 12-13-2012 at 11:23 AM.

  64. #64
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Excellent. Thanks very much for all your help on this thread. It has been a real help!

  65. #65
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    No problem, glad it got solved.

  66. #66
    Forum Contributor
    Join Date
    11-05-2012
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    107

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    So I put this code in the excel worksheet attached to post 41?

  67. #67
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Naja, yes put this code into the spreadsheet on post 41. This macro will allow you to create more than 10 reports.

  68. #68
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi Arlette,

    Its working brilliantly so far the only problem I'm finiding with it is if im looking for 3 holdings it will list profiles that contain these 3 holdings but also profiles that may contain more than 3 holdings. For example if Profile 1 contains AAA, BBB, CCC and Profile 2 contains AAA, BBB, CCC and DDD and I search for AAA, BBB, CCC it will list both profiles. I need it to be an exact match. Is there a possible way of doing this?

  69. #69
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Have you had a chance to look at my query above?

  70. #70
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Sorry i had unsubscribed from this thread so didnt get the email alert.

    Are you specifying AAA, BBB, CCC and DDD in the Holding Info tab or only AAA, BBB and CCC?

  71. #71
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Only AAA, BBB and CCC...I would only want Profile 1 to appear as it is an exact match. Although Profile 2 contains these holdings it also contains holding DDD. Its an exact match that I'm after

  72. #72
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    I have edited the code in post 63. Please try and let me know.

  73. #73
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi Arlette, unfortunately this hasn't worked. Same problem still occurs...

  74. #74
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi Arlette, have you had a chance to look at this problem?

  75. #75
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Sorry i didnt have internet since last night. Will work on it today.

  76. #76
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Try this code - managed to get it working with lots of trial and error -
    Please Login or Register  to view this content.

  77. #77
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi, been away all weekend so havent had a chance to look at the code until now. Working perfectly...thanks again for doing this. Its been a big help

  78. #78
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    No problem. Am glad its solved at last.

  79. #79
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Hi Arlette,

    Unfortunately it doesn't seem to be working. It worked on the first couple of examples I did but then the past few it hasn't worked. Sometimes it doesnt return anything, sometimes it returns an incomplete list. Any ideas for fixing it?

  80. #80
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Can you attach the file?

  81. #81
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    195

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Unfortunately not - it's got data on it I need kept private. Do you want me to go into more depth about the problems?

  82. #82
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [URGENT HELP REQUIRED] Macro to group informtion together

    Yes in the absence of test data, its very difficult to know what adjustments i need to add to the code.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1