Consulting

Results 1 to 2 of 2

Thread: If Value is >= 1 Take header and insert into row

  1. #1

    If Value is >= 1 Take header and insert into row

    I have an Excel workbook that is set-up like such
    A B C D E
    Run Walk Stomp Jump
    12 1 0 0 3
    22 2 2 0 0
    33 1 1 1 1
    44 1 0 0 0

    How could VBA syntax manipulate the workbook and add in a column if the cell value is > 0 so the data looks like this
    A B C D E F G H I
    12 Run 1 Jump 3
    22 Run 2 Walk 2
    33 Run 1 Walk 1 Stomp 1 Jump 1
    44 Run 1

    Now my production workbook extends to roughly P and has about 1400 rows in it, the above is just a subset of the data.

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    For questions like this, it's usually more effective to post a workbook with enough sample data to demonstrate the real situation and what you want to accomplish

    Less chance of misunderstanding and people are more likely to help if they don't have to create a workbook from scratch


    Now my production workbook extends to roughly P and has about 1400 rows in it, the above is just a subset of the data.
    So maybe attaching a workbook with 10 rows and data out to P, showing what you start with and what you want to end up with (maybe one sheet 'Before' and one sheet 'After')

    My sig has attaching instructions if you need them
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Posting Permissions

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