+ Reply to Thread
Results 1 to 37 of 37

Creating a matrix on a new sheet from data on another

  1. #1
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Creating a matrix on a new sheet from data on another

    I wonder if you experts can offer me some help. I've been tasked with doing an application audit of all the assets on site so I will be receiving spreadsheets with a list of assets and all the applications installed on that machine. I would like to take the asset numbers (the information in column A before the " ") and list them on a new sheet (removing duplicates) then merge the Product and Production version and move them to the new sheet (again removing duplicates), arranging them, alphabetically, as column headings with the text going vertically.

    Then i would like an "x" put in each cell where that asset has that application.

    Is this even possible?

    I have attached an example of the way in which i receive the information.Example Audit Data.xls

    Any help would be hugely appreciated.
    Last edited by badlydrunkboy; 12-19-2013 at 10:43 AM. Reason: Solved

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    Try this:-
    Results sheet3.
    Please Login or Register  to view this content.
    Regards Mick

  3. #3
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    That's amazing, thank you. two questions though;

    1. is there any way of sorting the applications into alphabetical order for easier reading?

    and

    2. Would this be reusable for other documents where the number of assets and applications will differ?

    Again, huge thanks for your help so far

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    Try the below for added code to sort "Applications" (Row 1).
    This code should work for any size of number of Rows as long as the same basic sheet format is used.
    Please Login or Register  to view this content.
    Regards Mick
    Last edited by MickG; 12-16-2013 at 08:18 AM.

  5. #5
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    Fantastic! Thank you so much.

    Just one more thing i've noticed. The Product and Production version columns on the spreadsheets i'll be getting are actually going to be columns E and F respectively (I deleted some columns to hide sensitive info) but I can't work out how to refer to these instead of C and D. Could you explain what I would need to change to correct this?

    Many thanks.
    Last edited by badlydrunkboy; 12-16-2013 at 10:12 AM.

  6. #6
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    You should just be able to alter the code line as shown below in Red.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    That was my first thought but when I do that, it creates the new sheet but doesn't populate any data into it.

  8. #8
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    Sorry , slight oversight there, I forgot the "Dn.offsets" further down needed altering.
    Try this:-
    Please Login or Register  to view this content.
    Regards Mick

  9. #9
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    Ahh, the old Dn.offsets.

    Amazing work, thank you mate.

  10. #10
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    You're welcome
    Regrds Mick

  11. #11
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    Some people are just never happy.

    I've had a request to add the Name from column B to the new sheet, either into column B, therefore just shifting all the application names and values along one, or by adding it to the contents already in column A, e.g. "L037845 Joe Bloggs". I'm usually ok with merging the vaules from two cells but I can't see in the code exactly where the vaule in A is found. Also The name of the original sheet (CS) will change for each workbook so I'm not sure how to find the value in B that relates to the value in A without refering to the sheet name.

    Really sorry about this.

    This is the code I have right now:
    Please Login or Register  to view this content.
    Last edited by badlydrunkboy; 12-17-2013 at 06:25 AM.

  12. #12
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    I'm not sure what you want , because Column "B" of sheet "CS" contains "Software Manufacturer" and That has as many different Names as there are Values of Column "A" Number, or perhaps I'm misunderstanding !!!!
    Example:- For Column "A" value "LO37845" ther are 6 different names , see below.

    Please Login or Register  to view this content.
    Regards Mick

  13. #13
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    Sorry Mick, that example sheet has columns missing. The one i'm actually using this macro on has the headers shown below

    Columns.JPG
    Last edited by badlydrunkboy; 12-17-2013 at 07:56 AM.

  14. #14
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    Can I then assume that any Unique number in column "A" will have the same matching unique Name in column "B".
    Regrds Mick

  15. #15
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    Column A is the asset number of the machine and column B is the person that asset is assigned to. The asset numbers are unique but one person can have more than one asset assigned to them and, as in the example above, the SHARED value may apply to a number assets. Does that make sense?

  16. #16
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    Try this:-
    Please Login or Register  to view this content.
    Regards Mick

  17. #17
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    Does that rely on the sheet containing the data being called CS? If so, it won't work because the name of that sheet will change each time.

  18. #18
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    Change the following at top of code:-
    From this:-
    Please Login or Register  to view this content.
    to this:-
    Please Login or Register  to view this content.

  19. #19
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    Brilliant, that works perfectly. Thank you so much!

  20. #20
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    Your welcome
    Regrds Mick

  21. #21
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    Mick,

    Sorry to be a pain but I have noticed that some of the results from the macro are incorrect. For example, the last asset number on my list (PC039885) has a 23 applications against it shown in the table. However, when the macro is run, the x's are not shown against the correct applications for that asset and there are only 19.

    Would you be able to take a look at it for me?

    If an example sheet would help, let me know and i'll create one. (A lot of the applications are very specific to where i'm working so it would take some work to remove these.)

    This is the code I'm currently running:

    Please Login or Register  to view this content.

  22. #22
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    On My sheet "PC039885" shows 18 assets and returns 18, however the the "c" variable count in the sort code is one short.
    Try altering the line below to add "1" as shown in red.
    Please Login or Register  to view this content.
    Regrds Mick

  23. #23
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    Fantastic, thank you!

  24. #24
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    Hi Mick,

    Sorry to bring this one up again but I was wondering if you could help. Some of the applications in the table are going to be replaced with new versions etc. How would I extend the range of fields that the macro puts together to put in Row1 on the Matrix? For example, all current versions of Firefox will be replaced by Internet Explorer 9 so I would like to the application name (Firefox) in row 1 to be struck through but have the new application name (Internet Explorer 9) after it, in the same cell.

    For example,

    [Strikethrough]Firefox 15[/Strikethrough] Internet Explorer 9

    So strikethrough doesn't work on here but you get the idea. I would be adding two new columns to the Audit table, after column F to put the new application name.

    Many thanks in advance

  25. #25
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    Try this:-
    New Code added at bottom of code.
    Please Login or Register  to view this content.

  26. #26
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    Thank you. That works great for Firefox but there will be a lot of replacements over time. I was kind of hoping to, manually, insert 2 columns after column F in the attached jpeg called "New Product" and "New Product Version" and put the new info in there and strikethrough the values in the previous two columns. Then, the matrix macro would just need to pull the combined value of E2, F2, G2, and H2, for example, into the column header.

    Does that make sense?
    Attached Images Attached Images

  27. #27
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    Try this Based on addition of new columns "G & H"
    Please Login or Register  to view this content.
    Last edited by MickG; 01-15-2014 at 11:01 AM.

  28. #28
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    When I run that I get following
    Attached Images Attached Images

  29. #29
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    Can you send a copy of your file

  30. #30
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    Here you go
    Attached Files Attached Files
    Last edited by badlydrunkboy; 01-15-2014 at 12:23 PM.

  31. #31
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    I've Attached and Run the code, Results sheet "Matrix"
    Attached Files Attached Files

  32. #32
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    Thank you for this but there are a couple of issues.

    1) If i put "Office" in G:30 and "Standard 2010" in H:30, it doesn't show in the Matrix in AM:1 as I would expect but if you also enter "Office" into G:37 and "Standard 2010" into H:37, cell AQ:1 displays correctly but still AM:1 doesn't.

    2) There seems to be a , before the name of the new application. Can that be removed? It just looks a little weird but when I tried to change it in the code things went a bit mental

    Many thanks again.

  33. #33
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    Not sure where the "a" is that you're referring to ????
    If I'm understanding you question correctly then:-
    The problem with your "Office" and "Standard 2010" in columns "G & H" is:-
    Columns "E & F" have Unique data in the 2 columns that repeat periodically down the column, but unless the Data in "G & H" is Unique with E & F" then the results will be seen in the Header as the last Values in "G & H" that relate the "E & F".
    Example:-
    If first instance in column E & F" = "Office" and "Professional XP" and columns "G & H" = "Office" and "2010" then for each "Office" & "Profesional XP" in columns "E & F" then the results in "G & H" must be "Office" and "2010" . The code can't handle something else unless you want to add a new column (Row 1) in sheet Matrix for each different version of "G & H".
    PS:- you need to add the line in red below to remove "Strikethrough" for each run of the code.
    Please Login or Register  to view this content.
    Last edited by MickG; 01-16-2014 at 12:05 PM.

  34. #34
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    Hmm, strangely enough, it seems to be doing what I would expect now

    My first question was badly worded, sorry. there is a "," before the name of the application. Can that be removed?
    Attached Files Attached Files

  35. #35
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    I was using it to Differentiate between "E & F" data and "G & H" data to know how far to to take the "strikethrough."
    I have now replaces it with a double space (" "). This seems to work Ok.
    New code with double spaces.
    Please Login or Register  to view this content.

  36. #36
    Forum Contributor
    Join Date
    02-15-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: Creating a matrix on a new sheet from data on another

    Perfect, thank you!

  37. #37
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Creating a matrix on a new sheet from data on another

    You're welcome
    Regrds Mick

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Rescale matrix of data to new sheet
    By pkirnos in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-18-2013, 03:33 PM
  2. [SOLVED] Creating a Matrix with Multiple Columns of Data
    By marktickle in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-08-2012, 09:58 PM
  3. Creating a data summary from a matrix
    By aaanenson in forum Excel General
    Replies: 1
    Last Post: 07-19-2012, 04:27 PM
  4. I need help creating a 3x3 Matrix in vba?
    By mattm99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2011, 03:36 PM
  5. Using data contained in a matrix table on another sheet
    By redimp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-18-2010, 01:50 PM

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