pasting from one sheet to another

  • Thread starter Thread starter jadeB
  • Start date Start date
J

jadeB

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
 
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"
<[email protected]>
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
 
Back
Top