+ Reply to Thread
Results 1 to 14 of 14

Combining row and column heading according to selected cell

  1. #1
    Registered User
    Join Date
    04-22-2013
    Location
    Ankara
    MS-Off Ver
    Excel 2007
    Posts
    30

    Question Combining row and column heading according to selected cell

    Hi all,

    ı could not find any formulas or example vba, so i wanted to ask you.

    I want to combine the column and the row headings according to selected cell. You can understand easily what I meant.

    Thanks again.
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Combining row and column heading according to selected cell

    Place the following code into the code module for your worksheet "Sayfa1" (not into a regular module). Just click on the desired cell.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-22-2013
    Location
    Ankara
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Combining row and column heading according to selected cell

    Thanks for helping but I could not run the code. Most probably I could not process what you told me. Can you place your code into what you told me?
    Or may be I could not tell what I want. When I run the code,the matris should be converted into 2 columns. First one is the merging the column heading and the row heading of the intersection of that row and that column, and the value should be written in the second column. Example of what I meant can be seen
    Last edited by Oxco; 04-24-2013 at 06:09 PM.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Combining row and column heading according to selected cell

    Hi Oxco. Have a look at this attachment. Just click on any cell in the 'S' columns. If this is not what you wanted, please provide a more detailed explanation.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-22-2013
    Location
    Ankara
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Combining row and column heading according to selected cell

    Yes, actually it is done. But is it possible when I click the "run" button of the macro, all cells of the matris converted into columns?

    Thanks again

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Combining row and column heading according to selected cell

    Hi Oxco. I just realized that some of the cells in the 'S' column are blank. Please replace the old code with the code below. This revised code ignores the blank cells.
    Please Login or Register  to view this content.
    I'm not sure what you mean when you say
    when I click the "run" button of the macro, all cells of the matris converted into columns?
    Do you have a button that runs another macro? Which cells do you want converted into columns?

  7. #7
    Registered User
    Join Date
    04-22-2013
    Location
    Ankara
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Combining row and column heading according to selected cell

    What I want is; when I click on any button we(you) formed, all of the cells('S' columns) of that matris are placed into columns. Withoutclicking any cell.

    When I run the macro, columns in the second sheet named "to be formed like that" will form automatically.
    Attached Files Attached Files

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Combining row and column heading according to selected cell

    Try the attached file. If I understood you correctly, you want column B in sheet "Sayfa2" to be updated automatically when you change the values in the 'S' columns in sheet "Sayfa1". I have done this by simply adding formulas in "Sayfa2" linking them to "Sayfa1". If this is not what you want, then I will need more clarification.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-22-2013
    Location
    Ankara
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Combining row and column heading according to selected cell

    You try a lot, thanks but again it is not my aim.

    convert.jpg like that

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Combining row and column heading according to selected cell

    Hi Oxco. Please try the attached file. I have added a button on your first sheet which when you click it, should copy the matrix to your second sheet. I have also unmerged the column headings because merged cell most often cause problems for Excel. You should avoid using merged cells if at all possible. Please let me know if this works for you.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    04-22-2013
    Location
    Ankara
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Combining row and column heading according to selected cell

    Yes, that's what I want. I'm really really thankful to you. =)

  12. #12
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Combining row and column heading according to selected cell

    It took a little time but we finally got there! I'm glad it worked out.

  13. #13
    Registered User
    Join Date
    04-27-2013
    Location
    Washington
    MS-Off Ver
    Excel for MAC 2011
    Posts
    4

    Re: Combining row and column heading according to selected cell

    example.xlsxScreen Shot 2013-04-27 at 9.02.18 AM.pngFirst of all, I need to apologize in advance for my ignorance, but I know NOTHING about macros. I am usually pretty good at getting formulas to do what I need, but in this case I have not been successful. Second, to be quite honest I am not entirely sure how to describe what it is I am trying to accomplish? But, here it goes anyway. I have an excel sheet containing one column of IDs and a second column of values that need to be associated to the first column. The problem is that the IDs in column A contain duplicates, which is okay because one ID can qualify for multiple values. What I need is to have a third column pull back the unique id, and a fourth column pull back a semi-colon delimited list of all of the values the id qualifies for. Hopefully the attached image makes sense?
    Last edited by eric.oc; 04-27-2013 at 02:14 PM. Reason: forgot to attach the sample file

  14. #14
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Combining row and column heading according to selected cell

    Hi Eric. Forum rules state that you shouldn't post your question in someone else's thread. Please start your own thread and post the question there.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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