Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Pasting stuff into new workbook

Hello All

I want to select a worksheet from a workbook, open a new workbook and
paste the worksheet into it. Almost all will be 'paste formulas' but
I want to be able, if possible, to paste some values instead in
certain cells. VBA beginner, so I've tried to do it with the record
method. Resulting macro copies the worksheet to the clipboard ok, but
then pastes it back into the same worksheet instead of a new workbook.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 221
Default Pasting stuff into new workbook

Try this

http://www.rondebruin.nl/copy2.htm

HTH
Mark.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Pasting stuff into new workbook

From the Macro Recorder:

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/27/2008 by James Ravenswood
'

'
Sheets("Sheet3").Copy
ChDir "C:\Documents and Settings\Owner\Desktop"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Owner\Desktop\Book4.xls",
FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
ActiveWorkbook.Close
End Sub

--
Gary''s Student - gsnu2007j


" wrote:

Hello All

I want to select a worksheet from a workbook, open a new workbook and
paste the worksheet into it. Almost all will be 'paste formulas' but
I want to be able, if possible, to paste some values instead in
certain cells. VBA beginner, so I've tried to do it with the record
method. Resulting macro copies the worksheet to the clipboard ok, but
then pastes it back into the same worksheet instead of a new workbook.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Pasting stuff into new workbook

On Jul 27, 12:35*pm, Gary''s Student
wrote:
From the Macro Recorder:

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/27/2008 by James Ravenswood
'

'
* * Sheets("Sheet3").Copy
* * ChDir "C:\Documents and Settings\Owner\Desktop"
* * ActiveWorkbook.SaveAs Filename:= _
* * * * "C:\Documents and Settings\Owner\Desktop\Book4.xls",
FileFormat:=xlNormal, _
* * * * Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
* * * * CreateBackup:=False
* * ActiveWorkbook.Close
End Sub

--
Gary''s Student - gsnu2007j



" wrote:
Hello All


I want to select a worksheet from a workbook, open a new workbook and
paste the worksheet into it. *Almost all will be 'paste formulas' but
I want to be able, if possible, to paste some values instead in
certain cells. *VBA beginner, so I've tried to do it with the record
method. *Resulting macro copies the worksheet to the clipboard ok, but
then pastes it back into the same worksheet instead of a new workbook.- Hide quoted text -


- Show quoted text -


Thanks, Nood & Gary. How can I adjust Macro2() to not save the new
workbook (the one pasted to) but just keep it open?
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy and Pasting to Another Workbook Lil Lisa Excel Discussion (Misc queries) 1 October 22nd 09 06:17 PM
Disable Pasting into a Workbook scottyboy Excel Worksheet Functions 2 May 9th 08 12:21 PM
pasting info from workbook to sheet in another workbook s_ali_hassan[_6_] Excel Programming 0 June 15th 06 01:48 PM
cut and pasting a row in another workbook on the next available l. stressed Excel Programming 2 August 29th 05 11:09 PM
Pasting from a specific Workbook to another workbook without having to name it. Sue[_6_] Excel Programming 1 September 18th 04 06:48 PM


All times are GMT +1. The time now is 09:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"