Results 1 to 6 of 6

VBA to scan a worksheet for a specific value, and return the header and first column value

Threaded View

  1. #1
    Registered User
    Join Date
    02-02-2018
    Location
    Quebec city
    MS-Off Ver
    2016
    Posts
    3

    VBA to scan a worksheet for a specific value, and return the header and first column value

    Hi folks !

    I'm trying to find a way to scan an excel sheet for a value an return the header value and the first column value of the intersection in another sheet.

    Basically, I have a sheet with headers (From B5 to CW5), and the A column also contains text values (A5 to A100).

    The following range contains calculation (numbers) values (B6:CW100).

    The logic would be :

    1) Scan sheet1 (B6:CW100) for values <>0
    2) when you get a value <>0,
    - Copy the value that is <> 0 in column A of sheet2
    - Copy the header (Value in row 5 of the intersection) in column B of sheet2
    - Copy the value that is in column A of the intersection in column C of sheet2
    3) It would have to be a Paste Value to make sure to get rid of the function

    The idea is to take a matrix and turn it into a table that can be used for a pivot table...

    Ex of data in sheet1 :

    X Y Z
    ValueA 0 125 2000
    Value B 5 0
    Value C 0 12 500

    The result would be in sheet2 :

    Value Column Header Line Header
    125 Y Value A
    2000 Z Value A
    5 X Value B
    12 Y Value C
    500 Z Value C

    Can anyone help me with this ? It seems like a decent challenge I tried looking for a solution online the whole day and I could not figure it out myself ...

    Thanks a lot for your help !
    Attached Files Attached Files
    Last edited by sboivin; 02-02-2018 at 03:59 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Return column header when specific value is found in row.
    By houlep in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-07-2017, 11:38 PM
  2. [SOLVED] Return Row heading by Column header and specific texted cell row position
    By Amolvijay in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-12-2014, 01:39 AM
  3. Replies: 1
    Last Post: 07-11-2014, 02:36 PM
  4. [SOLVED] Find specific value in table and return header row and header column value
    By nelwan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-30-2013, 01:35 AM
  5. Scan a row for text; return row and column header info
    By Kronote in forum Excel General
    Replies: 5
    Last Post: 06-02-2013, 06:43 PM
  6. Replies: 6
    Last Post: 07-26-2012, 06:34 PM
  7. scan data, find max value of column, return single record on other worksheet
    By virtualnoob in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-26-2012, 11:26 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