Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy Sheet - Paste Values

Hello, I hope someone can help me.

I am trying to copy an ENTIRE sheet from one workbook to
another. But, I want the copy to be pasted as "values". I
also need all the formatting, column widths, etc. to carry
over to the copy.

I can't get it to work using something like the following:

Sheets(argSourceSheet).Copy After:=Workbooks _
(argDestFile).Sheets(argPosition).PasteSpecial _
(Paste:=xlPasteValues)

I also tried something like the following to convert the
copied sheet to values after copying, but this fails also:

Workbooks(argNewFile).Sheets(argSheetName).UsedRan ge.Copy
Workbooks(argNewFile).Sheets(argSheetName).PasteSp ecial _
Paste:=xlPasteValues

I couldn't find a solution in "Help" on this.

1. Is there a way to do this in one line of code?

2. If not, how can I accomplish this most efficiently?

3. Your example code would be the best thing I could get.

Thanks in advance for your example code.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy Sheet - Paste Values

Hi Stone,

I had a posed a similar question not so long ago, the responses
received led me to the following code (amended to use your details): -


Workbooks(argNewFile).WorkSheets(argSheetName).Cel ls.Copy
With Workbooks(argNewFile).Sheets(argSheetName).
.PasteSpecial Paste:=xlFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Wit

--
Message posted from http://www.ExcelForum.com

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
How copy/paste values in Excel doc protected sheet 2 other doc? Got my CWC[_2_] Excel Discussion (Misc queries) 4 October 4th 08 01:28 AM
Copy from one Sheet and paste on another sheet based on condition Prem Excel Discussion (Misc queries) 2 December 24th 07 05:05 AM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
copy values generated by conditional formula in one sheet to the other work sheet as values ramana Excel Worksheet Functions 1 October 5th 05 01:04 PM
copy values generated by conditional formula in one sheet to the other work sheet as values bobby Excel Discussion (Misc queries) 1 October 5th 05 12:18 PM


All times are GMT +1. The time now is 06:17 AM.

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"