I have simple goal of copying range and pasting it into another spreadsheet
. The following code
below gives copies, but does not paste.
Sub Normalize()
Dim Ticker As Range
Sheets("Sheet1").Activate
Set Ticker = Range(Cells(2, 1), Cells(65, 1))
Ticker.Copy
Sheets("Sheet2").Select
Cells(1, 1).Activate
Ticker.PasteSpecial xlPasteAll
End Sub
Any suggestions?
To literally fix your example you would use this:
To Make slight improvments on it would be to get rid of the Select and Activates:
but using the clipboard takes time and resources so the best way would be to avoid a copy and paste and just set the values equal to what you want.
To define the
CopyFrom
you can use anything you want to define the range, You could useRange("A2:A65")
,Range("A2",[A65])
,Range("A2", "A65")
all would be valid entries. also if the A2:A65 Will never change the code could be further simplified to:I added the Copy from range, and the
Resize
property to make it slightly more dynamic in case you had other ranges you wanted to use in the future.I would try
This is what I came up to when trying to copy-paste excel ranges with it's sizes and cell groups. It might be a little too specific for my problem but...:
'** 'Copies a table from one place to another 'TargetRange: where to put the new LayoutTable 'typee: If it is an Instalation Layout table(1) or Package Layout table(2) '**
'** 'Receives the Pasted Table Range and rearranjes it's properties 'accordingly to the original CopiedTable 'typee: If it is an Instalation Layout table(1) or Package Layout table(2) '**