Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Paste Special between Spreadsheets

Hi -

I am automating some plan data that we have and seem to be running into a
problem using paste special to copy data from one spreadsheet to another. Is
there any restriction that dones not allow this? I have been able to
successfully write VBA code that copies and pastes the data that I need from
one spreadsheet to another - the only issue is that I would really rather
just past the values rather than the formulas as well (hence the need for
paste special). Does anyone have a simple example where they have gotten
this to work?

Thanks,
Meryl
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Paste Special between Spreadsheets

Hi -

I figured it out. Please ignore the previous post.

- Meryl

"Meryl Miller" wrote:

Hi -

I am automating some plan data that we have and seem to be running into a
problem using paste special to copy data from one spreadsheet to another. Is
there any restriction that dones not allow this? I have been able to
successfully write VBA code that copies and pastes the data that I need from
one spreadsheet to another - the only issue is that I would really rather
just past the values rather than the formulas as well (hence the need for
paste special). Does anyone have a simple example where they have gotten
this to work?

Thanks,
Meryl

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,316
Default Paste Special between Spreadsheets

The following code selects a contiguous block of cells in Sheet 1 of the
currently active workbook, copies the selection, opens a new workbook, does a
paste special and saves the new workbook.

Sub CopyPSpec()

Dim wb As Workbook
Dim ws As Worksheet

Set wb = ActiveWorkbook
Set ws = wb.Worksheets("Sheet1")

ws.Activate
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues
ActiveWorkbook.Save

Set ws = Nothing
Set wb = Nothing
Exit Sub

End Sub

--
Kevin Backmann


"Meryl Miller" wrote:

Hi -

I am automating some plan data that we have and seem to be running into a
problem using paste special to copy data from one spreadsheet to another. Is
there any restriction that dones not allow this? I have been able to
successfully write VBA code that copies and pastes the data that I need from
one spreadsheet to another - the only issue is that I would really rather
just past the values rather than the formulas as well (hence the need for
paste special). Does anyone have a simple example where they have gotten
this to work?

Thanks,
Meryl

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
Paste and Paste Special No Longer Working - Excel 2003 SheriJ Excel Discussion (Misc queries) 2 January 15th 09 09:23 PM
In Excel: add a Paste-Special Option to paste IN REVERSE ORDER. stan-the-man Excel Worksheet Functions 7 June 14th 06 08:10 PM
help w/ generic copy & paste/paste special routine DavidH[_2_] Excel Programming 5 January 23rd 06 03:58 AM
How do I capture user paste action and convert to Paste Special DonC Excel Programming 0 November 19th 04 01:43 PM
Dynamic Copy/Paste Special Formulas/Paste Special Values Sharon Perez Excel Programming 3 August 7th 04 09:49 PM


All times are GMT +1. The time now is 09:46 AM.

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

About Us

"It's about Microsoft Excel"