ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   pasting from one sheet to another (https://www.excelbanter.com/excel-programming/403096-pasting-one-sheet-another.html)

jadeB

pasting from one sheet to another
 
I believe I am making this too complicated.

The Start Here list of items and counts the number of items in C9.

I want to use the number of items to determine how many columns I need
on the other page + a column between each.

There is a dummy column in column "H" that I want to use for every
other column. I want the new group of cells to look like column H.

Why doesn't my code work? and what corrections do I need to make?

Thanks.


Sub Duplicate()

Dim i As Integer

Dim k As Integer

k = Sheets("start here").Range("c9")

For i = 1 To k

Sheets("Federal to State Reconciliation").Range("h6").copy
Sheets("Federal to State Reconciliation").Range("h6").Offset(0, i *
2).PasteSpecial

Application.CutCopyMode = False

Next

End Sub

Jim Cone

pasting from one sheet to another
 

You are copying and pasting a single cell.
To copy/paste the entire column, change ("h6") to ("h:h").
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"jadeB"

wrote in message
I believe I am making this too complicated.
The Start Here list of items and counts the number of items in C9.
I want to use the number of items to determine how many columns I need
on the other page + a column between each.
There is a dummy column in column "H" that I want to use for every
other column. I want the new group of cells to look like column H.
Why doesn't my code work? and what corrections do I need to make?
Thanks.


Sub Duplicate()
Dim i As Integer
Dim k As Integer
k = Sheets("start here").Range("c9")
For i = 1 To k
Sheets("Federal to State Reconciliation").Range("h6").copy
Sheets("Federal to State Reconciliation").Range("h6").Offset(0, i *
2).PasteSpecial
Application.CutCopyMode = False
Next
End Sub


All times are GMT +1. The time now is 12:30 PM.

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