View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Selection.Copy used in a variable.

Rick,

I forgot to mention that I changed
With Workbooks("TEMPLATE.xlsx")
to
With ActiveWorkbook


For easier testing but it shouldn't make any difference when you change it
back

Mike

"Rick S." wrote:

How do I pass the variable "vData"?
'======
lRow = Range("A1").End(xlDown).Address
'MsgBox lRow 'for testing
vData = Range("A1:" & lRow).Copy
With Workbooks("TEMPLATE.xlsx")
.Worksheets.Add After:=.Worksheets(.Worksheets.Count)
vData.Paste 'Object required?
End With
'======
--
Regards

VBA.Noob.Confused
XP Pro
Office 2007