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

I'm trying to get this simple code working but I get this following
error message.

Run-Time error '1004':
PasteSpecial Method of Range Class Failed

The following is the code.

L63 has a code of =SUM(L20:L50)

Range("L63").Select
Selection.Cut
Range("S1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Is there another "paste special - values" code that will work?

Ogopogo5

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Paste Special - Values code

Change "Cut" to "Copy"
--
Jim Cone
Portland, Oregon USA



"ogopogo5"
wrote in message
I'm trying to get this simple code working but I get this following
error message.

Run-Time error '1004':
PasteSpecial Method of Range Class Failed
The following is the code.
L63 has a code of =SUM(L20:L50)
Range("L63").Select
Selection.Cut
Range("S1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
Is there another "paste special - values" code that will work?
Ogopogo5
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Paste Special - Values code

You have not copied anything so there is nothing to paste. That being said
you do not need to copy and paste at all. Try this one line...

Range("S1").value = range("L63").value
--
HTH...

Jim Thomlinson


"ogopogo5" wrote:

I'm trying to get this simple code working but I get this following
error message.

Run-Time error '1004':
PasteSpecial Method of Range Class Failed

The following is the code.

L63 has a code of =SUM(L20:L50)

Range("L63").Select
Selection.Cut
Range("S1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Is there another "paste special - values" code that will work?

Ogopogo5

*** Sent via Developersdex http://www.developersdex.com ***

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Paste Special - Values code

Thank you Jim. I will use your code Range("S1").value =
range("L63").value as it works.

Ogopogo5

*** Sent via Developersdex http://www.developersdex.com ***
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Paste Special - Values code


Be advised that when you use this for more than ONE cell you make sure they
are the same size ranges.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"ogopogo5" wrote in message
...
Thank you Jim. I will use your code Range("S1").value =
range("L63").value as it works.

Ogopogo5

*** Sent via Developersdex
http://www.developersdex.com ***



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Paste Special - Values code

Hi Jim,

I'm searching for a way to Paste Special and came across what you answer to
ogopogo5.
And so I try your method of Range("S1").value = range("L63").value

Except that it also paste along with the format that I place in the column
that I did originally - Data Validation - DropDown List.

Is there a way paste special so that on the text come along and NOT the
spcial formatting?

Thank you,
Neon520


"Jim Thomlinson" wrote:

You have not copied anything so there is nothing to paste. That being said
you do not need to copy and paste at all. Try this one line...

Range("S1").value = range("L63").value
--
HTH...

Jim Thomlinson


"ogopogo5" wrote:

I'm trying to get this simple code working but I get this following
error message.

Run-Time error '1004':
PasteSpecial Method of Range Class Failed

The following is the code.

L63 has a code of =SUM(L20:L50)

Range("L63").Select
Selection.Cut
Range("S1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Is there another "paste special - values" code that will work?

Ogopogo5

*** Sent via Developersdex http://www.developersdex.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
Paste special values but not... aprillachlan Excel Worksheet Functions 3 June 26th 06 05:47 PM
Paste Special - Values KYMO Excel Worksheet Functions 1 June 8th 06 05:17 PM
paste special values baiju101 Excel Worksheet Functions 1 April 4th 06 02:11 PM
Modify this code to paste special, values Jonsson[_41_] Excel Programming 4 September 5th 04 10:03 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 10:00 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"