Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help! What's wrong with this simple copy and paste

This copy and paste does not work with my userform,
however it directly copied out of a macro I did.

Any help will be appreciated!

Worksheets("Report").Range("D48").Select
Selection.Copy
Sheets("Inputs").Select
Range("M16").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default Help! What's wrong with this simple copy and paste

It worked for me with xl2000 when used as a Commandbutton
click event. However, I would suggest greatly simplifying
it by not doing all that selecting. Also forget the copy
and paste. Try this simple code instead:

Sheets("Inputs").Range("M1") = Sheets("Report").Range("D1")

-----Original Message-----
This copy and paste does not work with my userform,
however it directly copied out of a macro I did.

Any help will be appreciated!

Worksheets("Report").Range("D48").Select
Selection.Copy
Sheets("Inputs").Select
Range("M16").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Help! What's wrong with this simple copy and paste

Sheets("Inputs").Range("M1") = Sheets("Report").Range("D1")
works fine for ONE value but if multiple values the range sizes must match
and you need to use .value at the end of the source range. See example
below.

Sub copyover()
Sheets("Sheet10").Range("d15:d17") = Sheets("sheet8").Range("e12:e14").Value
'or
'[Sheet10!d15:d17] = [sheet8!e12:e14].Value
End Sub


--
Don Guillett
SalesAid Software

"Greg Wilson" wrote in message
...
It worked for me with xl2000 when used as a Commandbutton
click event. However, I would suggest greatly simplifying
it by not doing all that selecting. Also forget the copy
and paste. Try this simple code instead:

Sheets("Inputs").Range("M1") = Sheets("Report").Range("D1")

-----Original Message-----
This copy and paste does not work with my userform,
however it directly copied out of a macro I did.

Any help will be appreciated!

Worksheets("Report").Range("D48").Select
Selection.Copy
Sheets("Inputs").Select
Range("M16").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Help! What's wrong with this simple copy and paste

Further, if your range is not a single cell, you can use the copy method:
Sheets("Inputs").Range("M1:AZ41") .copy destination: ...
"Greg Wilson" wrote in message
...
It worked for me with xl2000 when used as a Commandbutton
click event. However, I would suggest greatly simplifying
it by not doing all that selecting. Also forget the copy
and paste. Try this simple code instead:

Sheets("Inputs").Range("M1") = Sheets("Report").Range("D1")

-----Original Message-----
This copy and paste does not work with my userform,
however it directly copied out of a macro I did.

Any help will be appreciated!

Worksheets("Report").Range("D48").Select
Selection.Copy
Sheets("Inputs").Select
Range("M16").Select
Selection.PasteSpecial Paste:=xlValues,
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
Simple Macro - I think... Copy - Paste on Click Scott Campbell[_2_] Excel Discussion (Misc queries) 5 November 14th 12 12:52 AM
Line copy - Not just a simple copy paste Ninerref Excel Worksheet Functions 3 September 10th 09 11:44 AM
copy-paste started misbehaving (cell reference wrong) [email protected] Excel Discussion (Misc queries) 1 April 17th 07 07:09 AM
How to write a simple copy-paste macro? R. H. Rosenberg New Users to Excel 4 November 25th 06 12:26 AM


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