PDA

View Full Version : If Value is >= 1 Take header and insert into row



juan4412
12-13-2017, 06:46 PM
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.

Paul_Hossler
12-13-2017, 08:23 PM
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