ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to Copy Grid Header (https://www.excelbanter.com/excel-programming/356752-macro-copy-grid-header.html)

Jason Heider

Macro to Copy Grid Header
 
I have the following grid setup:

Amount 1 Amount 2
1/1/05 $500.00 $400.00
1/2/05 $425.00 $325.00
1/3/05 $250.00 $100.00
....

I would like to copy to create the following:

1/1/05 $500.00 Amount 1
1/2/05 $425.00 Amount 1
1/3/05 $250.00 Amount 1
1/1/05 $400.00 Amount 2
1/2/05 $325.00 Amount 2
1/3/05 $100.00 Amount 2

I have gotten everything working except copying the Amount 1 / Amount 2
multiple times in the last column.

Please help!!


KC

Macro to Copy Grid Header
 
May be you can try

lastrow=range("A2").end(xldown).row
range("C2:C" & lastrow)="Amount1"
range("C" & lastrow+1 & ":C" & 2*lastrow -1)="Amount2"


"Jason Heider" wrote:

I have the following grid setup:

Amount 1 Amount 2
1/1/05 $500.00 $400.00
1/2/05 $425.00 $325.00
1/3/05 $250.00 $100.00
...

I would like to copy to create the following:

1/1/05 $500.00 Amount 1
1/2/05 $425.00 Amount 1
1/3/05 $250.00 Amount 1
1/1/05 $400.00 Amount 2
1/2/05 $325.00 Amount 2
1/3/05 $100.00 Amount 2

I have gotten everything working except copying the Amount 1 / Amount 2
multiple times in the last column.

Please help!!



All times are GMT +1. The time now is 02:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com