Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 204
Default paste special code

i have copied a worksheet to a new worksheet with

wb.Sheets("A Lap").Range("a1:" & Cells(ARow, MaxA).Address).Copy
wbNew.Sheets("Sheet1").Range("A2")

I just realised the filed are now linked. how do I paste special so that
only the values get saved in the new worksheet.

I gather I have to use this

PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

but don't know where to incorporate it.


Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default paste special code

Hi

Try this:

wb.Sheets("A Lap").Range("a1:" & Cells(ARow, MaxA).Address).Copy

wbNew.Sheets("Sheet1").Range("A2").PasteSpecial _
Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Application.CutCopyMode = False

Regards,
Per

On 22 Jul., 08:33, NDBC wrote:
i have copied a worksheet to a new worksheet with

wb.Sheets("A Lap").Range("a1:" & Cells(ARow, MaxA).Address).Copy
wbNew.Sheets("Sheet1").Range("A2")

I just realised the filed are now linked. how do I paste special so that
only the values get saved in the new worksheet.

I gather I have to use this

PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
* * * * :=False, Transpose:=False

but don't know where to incorporate it.

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default paste special code

Try the below which is equivalent to PasteSpecial

Dim arrData as Variant
arrData = wb.Sheets("A Lap").Range("a1" , Cells(ARow, MaxA))
wbNew.Sheets("Sheet1").Range("A2").Resize(UBound(a rrData, 1), _
UBound(arrData, 2)) = arrData

If this post helps click Yes
---------------
Jacob Skaria


"NDBC" wrote:

i have copied a worksheet to a new worksheet with

wb.Sheets("A Lap").Range("a1:" & Cells(ARow, MaxA).Address).Copy
wbNew.Sheets("Sheet1").Range("A2")

I just realised the filed are now linked. how do I paste special so that
only the values get saved in the new worksheet.

I gather I have to use this

PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

but don't know where to incorporate it.


Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 204
Default paste special code

Thanks, worked a treat.


"Per Jessen" wrote:

Hi

Try this:

wb.Sheets("A Lap").Range("a1:" & Cells(ARow, MaxA).Address).Copy

wbNew.Sheets("Sheet1").Range("A2").PasteSpecial _
Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Application.CutCopyMode = False

Regards,
Per

On 22 Jul., 08:33, NDBC wrote:
i have copied a worksheet to a new worksheet with

wb.Sheets("A Lap").Range("a1:" & Cells(ARow, MaxA).Address).Copy
wbNew.Sheets("Sheet1").Range("A2")

I just realised the filed are now linked. how do I paste special so that
only the values get saved in the new worksheet.

I gather I have to use this

PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

but don't know where to incorporate it.

Thanks



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 204
Default paste special code

Thanks jacob. One problem I am facing with paste special is I am loosing font
size and formatting for headings. does this method get around that and keep
formatting.



"Jacob Skaria" wrote:

Try the below which is equivalent to PasteSpecial

Dim arrData as Variant
arrData = wb.Sheets("A Lap").Range("a1" , Cells(ARow, MaxA))
wbNew.Sheets("Sheet1").Range("A2").Resize(UBound(a rrData, 1), _
UBound(arrData, 2)) = arrData

If this post helps click Yes
---------------
Jacob Skaria


"NDBC" wrote:

i have copied a worksheet to a new worksheet with

wb.Sheets("A Lap").Range("a1:" & Cells(ARow, MaxA).Address).Copy
wbNew.Sheets("Sheet1").Range("A2")

I just realised the filed are now linked. how do I paste special so that
only the values get saved in the new worksheet.

I gather I have to use this

PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

but don't know where to incorporate it.


Thanks



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default paste special code

Try the below..Repeat the paste special with formats

wb.Sheets("A Lap").Range("a1:" & Cells(ARow, MaxA).Address).Copy

wbNew.Sheets("Sheet1").Range("A2").PasteSpecial _
Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

wbNew.Sheets("Sheet1").Range("A2").PasteSpecial _
Paste:=xlPasteFormats Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Application.CutCopyMode = False



--
If this post helps click Yes
---------------
Jacob Skaria


"NDBC" wrote:

Thanks jacob. One problem I am facing with paste special is I am loosing font
size and formatting for headings. does this method get around that and keep
formatting.



"Jacob Skaria" wrote:

Try the below which is equivalent to PasteSpecial

Dim arrData as Variant
arrData = wb.Sheets("A Lap").Range("a1" , Cells(ARow, MaxA))
wbNew.Sheets("Sheet1").Range("A2").Resize(UBound(a rrData, 1), _
UBound(arrData, 2)) = arrData

If this post helps click Yes
---------------
Jacob Skaria


"NDBC" wrote:

i have copied a worksheet to a new worksheet with

wb.Sheets("A Lap").Range("a1:" & Cells(ARow, MaxA).Address).Copy
wbNew.Sheets("Sheet1").Range("A2")

I just realised the filed are now linked. how do I paste special so that
only the values get saved in the new worksheet.

I gather I have to use this

PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

but don't know where to incorporate it.


Thanks

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 Special - Values code ogopogo5 Excel Programming 5 December 22nd 08 09:05 PM
Simplify Code for Copy/Paste Special Active VBA Excel Programming 10 September 3rd 08 11:48 AM
Code Assistance (Paste Special) Tom Taetsch Excel Programming 1 October 31st 04 11:49 PM
Modify this code to paste special, values Jonsson[_41_] Excel Programming 4 September 5th 04 10:03 PM
Copy Paste Special Value using Code over Several Worksheets John[_81_] Excel Programming 1 April 19th 04 12:09 PM


All times are GMT +1. The time now is 01:44 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"