Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Pass Data from one work book to another in VBA?

  Asked By: Molly    Date: Nov 25    Category: MS Office    Views: 901
  

I submitted a more complex version of this code previously, be here
is where what my problem is...

I have data in a form on one sheet in Workbook1 and I want to copy it
to a new sheet in a new workbook. Stepping thru it, it works all the
way up till the point I go to paste the data.

This is the code I have and I don't know why it's blowing up and,
more importantly, how to fix it.

Any suggestions????



Sub test()

Dim Wk As Workbook
Dim Wk2 As Workbook


Set Wk = ActiveWorkbook
Set Wk2 = Workbooks.Add



Wk.Activate
Sheets("Sheet1").Select
Cells.Select
Selection.Copy

Wk2.Activate
ActiveWorkbook.Worksheets.Add
ActiveSheet.Paste


End Sub

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Jared Adams     Answered On: Nov 25

Use pastespecial function instead of past function for copying.

 
Didn't find what you were looking for? Find more on Pass Data from one work book to another in VBA? Or get search suggestion and latest updates.




Tagged: