Column index

  • Thread starter Thread starter Geo
  • Start date Start date
G

Geo

This is just part of a module code I have. The problem I am having is when
the paste data it only paste to one colunm (B). I need it to paste from col
"B" to "AG"
Any ideas??


Sub NewPeriod()
If MsgBox("Confirm you are ready to create the next 28 day period?" &
Chr(13) & Chr(13) & "Note: The data for the 28 day period twelve months ago"
& Chr(13) & "will be permanently lost.", vbYesNo + vbQuestion, "Duty Sheet")
= vbYes Then Else Exit Sub
P = Range("CC18")
Range("B7:AG51").Copy
Cells(643 - (45 * P), 2).PasteSpecial Paste:=xlPasteValues
Range("CC18") = 0
Range("B103:AG687").Copy
Range("B58").PasteSpecial Paste:=xlPasteValues
Range("B643:AG687").ClearContents
Range("CC16").Formula = Range("CC16") + 45
Range("B7:AG51").ClearContents
Range("B7").Select
End Sub
 
I don't see anything in your code that looks like it would only paste into a
single column.

Are you sure that your data being copied has more than column worth of
information in it?

I'd step through the code (using F8) and toggle back to excel to see what was
going on.
 
Back
Top