Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default PasteSpecial macro

Good evening,

Need some help to clean up the recorded macro below. Sheet1 is the
ActiveSheet.
Trying to paste the values of Range("A1:A10") to Sheet2. Cant find out the
right syntax.
Thankful for any hints.

Brgds

CG Rosén
---------------------------------------------------------------------
Sheets("Sheet1").Select
Range("A1:A10").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks
_
:=False, Transpose:=False


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default PasteSpecial macro

Sheets("Sheet1").Range("A1:A10").Copy
Sheets("Sheet2").Range("A1").PasteSpecial _
Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False

Doesn't make any difference which sheet is the activesheet.

Sheets("Sheet2").Range("A1:A10").Value = _
Sheets("Sheet1).Range("A1:A10").Value

is another way to do it.

--
Regards,
Tom Ogilvy


CG Rosén wrote in message
...
Good evening,

Need some help to clean up the recorded macro below. Sheet1 is the
ActiveSheet.
Trying to paste the values of Range("A1:A10") to Sheet2. Cant find out the
right syntax.
Thankful for any hints.

Brgds

CG Rosén
---------------------------------------------------------------------
Sheets("Sheet1").Select
Range("A1:A10").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,

SkipBlanks
_
:=False, Transpose:=False




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default PasteSpecial macro

Maybe:

Option Explicit

Sub testme02()

Dim rng As Range
Set rng = Worksheets("sheet1").Range("a1:a10")

rng.Copy
Worksheets("sheet2").Range("a1").PasteSpecial Paste:=xlPasteValues

End Sub

but you could just assign the value, too:

Sub testme02()

Dim rng As Range
Set rng = Worksheets("sheet1").Range("a1:a10")

Worksheets("sheet2").Range("A1") _
.Resize(rng.Rows.Count, rng.Columns.Count).Value _
= rng.Value

End Sub



"CG Rosén" wrote:

Good evening,

Need some help to clean up the recorded macro below. Sheet1 is the
ActiveSheet.
Trying to paste the values of Range("A1:A10") to Sheet2. Cant find out the
right syntax.
Thankful for any hints.

Brgds

CG Rosén
---------------------------------------------------------------------
Sheets("Sheet1").Select
Range("A1:A10").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks
_
:=False, Transpose:=False


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default PasteSpecial macro

CG

You do not have to copy the data, this will perform the
same action

Sub pasteValues()
Sheets("Sheet2").Range("A1:A10").Value = _
Sheets("Sheet1").Range("A1:A10")

End Sub

Regards
Peter
-----Original Message-----
Good evening,

Need some help to clean up the recorded macro below.

Sheet1 is the
ActiveSheet.
Trying to paste the values of Range("A1:A10") to Sheet2.

Cant find out the
right syntax.
Thankful for any hints.

Brgds

CG Rosén
----------------------------------------------------------

-----------
Sheets("Sheet1").Select
Range("A1:A10").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues,

Operation:=xlNone, SkipBlanks
_
:=False, Transpose:=False


.

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
vba pastespecial joao Excel Programming 2 November 14th 03 03:31 PM
PasteSpecial problem Jim Rech Excel Programming 0 November 4th 03 04:47 PM
A More Effective Way of Using PasteSpecial? CalumMurdo Kennedy Excel Programming 7 October 30th 03 02:49 AM
PasteSpecial:VBA vs right click Rob Bovey Excel Programming 1 August 14th 03 12:26 AM
pastespecial billQ Excel Programming 2 July 29th 03 11:39 PM


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