D
DavidH
I'm trying to write a macro that rearranges a named range to facilitate pivot
table manipulation. For example, if A13 is named "MyRange" and is set up as
follows:
..........North..South..East..West
Jan....100.....200.....300...400
Feb....500.....600.....700...800
Mar...250......350.....450...550
I'd like to rearrange the data on a new sheet as follows:
Jan..North...100
Jan..South...200
Jan..East.....300
Jan..West....400
Feb..North...500
Feb..South...600
Feb..East.....700
Feb..West....800
Mar..North...250
Mar..South...350
Mar..East......450
Mar..West.....550
I run into this situation often, and I've simplified the example above for
presentation purposes. Usually I find myself with several columns of data
that I'd like to repeat, for example an account number, project number, and
department id (these columns would replace the months in the example above)
followed by a column for each month. Also, different people hand their
worksheets over to me, so the format & style differs; for instance one person
may leave zero value cells blank.
Any suggestions on how I can write a generalized macro to handle this
situation would be greatly appreciated.
Thanks,
David
table manipulation. For example, if A13 is named "MyRange" and is set up as
follows:
..........North..South..East..West
Jan....100.....200.....300...400
Feb....500.....600.....700...800
Mar...250......350.....450...550
I'd like to rearrange the data on a new sheet as follows:
Jan..North...100
Jan..South...200
Jan..East.....300
Jan..West....400
Feb..North...500
Feb..South...600
Feb..East.....700
Feb..West....800
Mar..North...250
Mar..South...350
Mar..East......450
Mar..West.....550
I run into this situation often, and I've simplified the example above for
presentation purposes. Usually I find myself with several columns of data
that I'd like to repeat, for example an account number, project number, and
department id (these columns would replace the months in the example above)
followed by a column for each month. Also, different people hand their
worksheets over to me, so the format & style differs; for instance one person
may leave zero value cells blank.
Any suggestions on how I can write a generalized macro to handle this
situation would be greatly appreciated.
Thanks,
David