ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Values From Worksheet to another Worksheet same Workbook (https://www.excelbanter.com/excel-programming/398832-copy-values-worksheet-another-worksheet-same-workbook.html)

Joe K.

Copy Values From Worksheet to another Worksheet same Workbook
 

I would like to created a macro that will copy the values from Sheet1
worksheet into the Test1 worksheet in the same workbook with format listed
below. Sheet1 the Date field is column B, Cost field is column C, and the
Price field is column F.


Please help me create this macro.

Thanks,




Sheet1
Date(B) Cost(C) Price(F)
08/27/06 5.48 6.89
08/28/06 12.59 10.02
08/29/06 16.24 13.42
....
09/01/07 24.24 30.31


Test1
Column(C) Column(G) Column(F)
08/27/06 5.48 Cost
08/27/06 6.89 Price
08/28/06 12.59 Cost
08/28/06 10.02 Price
08/29/06 16.24 Cost
08/29/06 13.24 Price
....
09/01/07 24.24 Cost
09/01/07 30.31 Price


joel

Copy Values From Worksheet to another Worksheet same Workbook
 
This is pretty simple.

Sub movesheet()

With Sheets("Sheet1")
.Columns("B:B").Copy _
Destination:=Sheets("Test").Columns("C:C")
.Columns("C:C").Copy _
Destination:=Sheets("Test").Columns("G:G")
.Columns("F:F").Copy _
Destination:=Sheets("Test").Columns("F:F")
End With

End Sub

"Joe K." wrote:


I would like to created a macro that will copy the values from Sheet1
worksheet into the Test1 worksheet in the same workbook with format listed
below. Sheet1 the Date field is column B, Cost field is column C, and the
Price field is column F.


Please help me create this macro.

Thanks,




Sheet1
Date(B) Cost(C) Price(F)
08/27/06 5.48 6.89
08/28/06 12.59 10.02
08/29/06 16.24 13.42
...
09/01/07 24.24 30.31


Test1
Column(C) Column(G) Column(F)
08/27/06 5.48 Cost
08/27/06 6.89 Price
08/28/06 12.59 Cost
08/28/06 10.02 Price
08/29/06 16.24 Cost
08/29/06 13.24 Price
...
09/01/07 24.24 Cost
09/01/07 30.31 Price



All times are GMT +1. The time now is 11:33 AM.

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