+ Reply to Thread
Results 1 to 17 of 17

Search Function, ROW WISE Results to COLUMN WISE Results

  1. #1
    Registered User
    Join Date
    05-09-2013
    Location
    Jeddah
    MS-Off Ver
    Excel 2010
    Posts
    9

    Search Function, ROW WISE Results to COLUMN WISE Results

    The file attached was retrieved by me through browsing excel forums. I apologize if I couldn't give credits to the one who made this file as I cannot find anymore to where I got this excel file. Anyway thank you very much, it was really a big help to me.

    I run the system using search button in the Sheet2 and currently, the working function is through the input of information in Sheet2(Result) C5 as Search Bar where you can put and search any criteria mentioned in Sheet1(Table) Column A, results will be generated in row wise. For example Input Value of "A2 (which is '1')" then information ROW WISE in "A2", "B2", "C2", an so on will appear on the Sheet2.

    However,can anyone help me to reverse the function from ROW WISE to COLUMN WISE results. Criterias to be input would be in ROW 1 Details and the expected result should be the whole details of a Column and as long as it could be. Thank you very much for reading this post.
    Attached Files Attached Files
    Last edited by juanl; 06-26-2013 at 08:39 AM.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Search Function, ROW WISE Results to COLUMN WISE Results

    Criterias to be input would be in ROW 1 Details and the expected result should be the whole details of a Column and as long as it could be.
    Can you show your above expectation in a excel sheet ? thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

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

    Re: Search Function, ROW WISE Results to COLUMN WISE Results

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-09-2013
    Location
    Jeddah
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Search Function, ROW WISE Results to COLUMN WISE Results

    Thanks for replies, For your reference also, the original codes I have right now is below:

    Please Login or Register  to view this content.
    The search results gives me a ROW wise results based on the Column A values. But now, I needed to disregard Column A as my criterias and will be used Column headers instead. I really need to have a column wise result upon searching on any values of column headers. The bottom line is that "to find headings and copy entire column in another sheet" Can anyone help me, please. Thanks!
    Last edited by juanl; 06-26-2013 at 07:24 AM.

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

    Re: Search Function, ROW WISE Results to COLUMN WISE Results

    juanl,
    Please use code tags with your code.
    My amended code copies in to column. Have you tried it before we go in to next request?

  6. #6
    Registered User
    Join Date
    05-09-2013
    Location
    Jeddah
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Search Function, ROW WISE Results to COLUMN WISE Results

    Yes Sir, I tried to run the codes but there's no response. Can you extend your help please.

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

    Re: Search Function, ROW WISE Results to COLUMN WISE Results

    There is. See attached. It pastes and transpose in to columns.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-09-2013
    Location
    Jeddah
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Search Function, ROW WISE Results to COLUMN WISE Results

    Sir, I got your file, I noticed that when I open your sample there is a data which are already in a column, but if I search for a value in the search bar, the operations returns to its previous ROW wise results. Furthermore, the results that I really needed is to have the entire columns of A if I searched for "A" or any value of column head and not to transpose the results from rows to columns. Sorry if my starting explanation is confusing.

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

    Re: Search Function, ROW WISE Results to COLUMN WISE Results

    I have change the value of 1 in to 2 and got a new data in a column.
    I suspect you are running the code from the button and button is linked to the old code, not the new code.
    Look at the name of the new sub

    Please Login or Register  to view this content.
    You either attach your button to the new code, or run the code from the module itself.

  10. #10
    Registered User
    Join Date
    05-09-2013
    Location
    Jeddah
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Search Function, ROW WISE Results to COLUMN WISE Results

    Yes, I run the code with the button in Sheet2. I removed the old code but I don't know why it is not working.
    Last edited by juanl; 06-26-2013 at 08:37 AM.

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

    Re: Search Function, ROW WISE Results to COLUMN WISE Results

    Please do the following.
    change the value of 1 in to 2, then go in to the module, run it step by step by pressing F8 and see what you get.
    But first, you need to remove my code from the sheet in to a module. Currently, you have the code stored in sheet, it should go in to a module. Do not store modules in sheet unless they are event driven code. So, copy my code, go to insert, module and paste it. Once you have moved out of sheet in to module, delete it from the sheet

  12. #12
    Registered User
    Join Date
    05-09-2013
    Location
    Jeddah
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Search Function, ROW WISE Results to COLUMN WISE Results

    Sir, thanks for you reply. It is now working but the data that were taken are the data in a row which will be transposed into column. I really needed to take the entire column values. Related to that and based on your code I come up with this code:
    Please Login or Register  to view this content.
    I have seen that I already copied the entire columns as I tried to paste somewhere after clicking debug. I want to paste it in F1 if possible. Can you help me with this. Please.
    Last edited by juanl; 06-26-2013 at 10:21 AM.

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

    Re: Search Function, ROW WISE Results to COLUMN WISE Results

    It is not my code, but I have amended your own code.
    Your first code, looks for value in column A and when it finds it copies the entire row and paste and transpose.
    Please Login or Register  to view this content.
    Now, you have change the searched columns

    Please Login or Register  to view this content.
    My question is: What do you want to do when a match is found? The match could be found anywhere between columns A to AZ. Which columns do you want to copy? Forget transposing for now as it comes from paste, it is a row is copied into columns and viceversal.

  14. #14
    Registered User
    Join Date
    05-09-2013
    Location
    Jeddah
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Search Function, ROW WISE Results to COLUMN WISE Results

    Quote Originally Posted by AB33 View Post
    My question is: What do you want to do when a match is found? The match could be found anywhere between columns A to AZ. Which columns do you want to copy? Forget transposing for now as it comes from paste, it is a row is copied into columns and viceversal.
    If this happens, I need all of the columns with same headings. Thanks for asking it is very important.

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

    Re: Search Function, ROW WISE Results to COLUMN WISE Results

    Please Login or Register  to view this content.
    Trying to find the value of C5 in A1: AZ1 and will find nothing. Reason: The value you have is found in column A, starting from 2 while you are looking in row1 . Please attach a new sample data and will adjust the code.

  16. #16
    Registered User
    Join Date
    05-09-2013
    Location
    Jeddah
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Search Function, ROW WISE Results to COLUMN WISE Results

    Sorry for the late reply. I did some changes with the uploaded file. please check it.

    Right now, my Column Headers are Groups A~D(ROW 1), but Column Header would not be unique as I am going to group some Control No. which is in ROW 2.

    Control No. 111 to 113 Belongs to Group A. In this regard, I expect columns of B,C,D as result if I searched for Group A in the Result Sheet. (Which is not working right now)

    Can you help me with the following:

    1. How can I control the result location, right now the result is showing in the column of F. How can I make the result to be shown in B8.
    2. The results only showing 1 Column, I am expecting duplicates column headers to be put in this file as I am going to group some data. Same Column heads could be too many.

    Here is the active code for your reference:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by juanl; 06-27-2013 at 02:27 AM.

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

    Re: Search Function, ROW WISE Results to COLUMN WISE Results

    This answers question 1, but I am not sure I understand question 2. Try this one and come back with clear request.

    Please Login or Register  to view this content.

+ 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