(Solved) – VBA, if a column header is greater than 0, return the whole column on a new page

  • by
(solved)-–-vba,-if-a-column-header-is-greater-than-0,-return-the-whole-column-on-a-new-page

I have a headcount model that has shifts in the range [J-14 to BRM-3000]; J and BRM being the columns.
In Row 13, solver counts if there is a shift in that column below and returns 1 if there is, 0 if not.

The range [J13 to BRM13] either contains 1s or 0s.
What I would like to do is write a macro that checks all the columns in Row 13 that are greater than 0, and output the whole column in a different sheet.
And then output the next column with a value in Row 13 greater than 0 into the column adjacent to the output 1 and so on and so forth.
So if 13 columns have a 1 in row 13 of sheet 1, then the output on a sheet 2 should be those 13 columns all next to each other.

Does that Makes Sense? Please let me know if I should clarify or attach an example in a workbook.

Leave a Reply

Your email address will not be published. Required fields are marked *