#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Pasting

I get a 1004 error code that states that the PasteSpecial Method of Range
Class Failed with the following

Columns("C:C").Select
Application.CutCopyMode = False
Selection.Copy
Range("E1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Is there a way to fix this?

Jim

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Pasting

here are 3 differsnt ways, pick the one you want to use.

Sub test()
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
ws.Columns("E").Value = ws.Columns("C").Value
End Sub


Sub test1()
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
ws.Columns("C:C").Copy
ws.Range("E1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
End Sub


Sub test2()
Dim lastrow As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
lastrow = ws.Cells(Rows.Count, "C").End(xlUp).Row
ws.Range("E1:E" & lastrow).Value = ws.Range("C1:C" & lastrow).Value
End Sub


--


Gary Keramidas
Excel 2003


"Jim Berglund" wrote in message
...
I get a 1004 error code that states that the PasteSpecial Method of Range
Class Failed with the following

Columns("C:C").Select
Application.CutCopyMode = False
Selection.Copy
Range("E1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Is there a way to fix this?

Jim


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Pasting

Gary, I received your recoded application and was delighted with it. It
taught me a couple of new ways to think about the problem, and offered a
variety of new approaches that I'd have never considered (previously)

Thanks so much for your terrific support!
Jim

"Gary Keramidas" wrote in message
...
here are 3 differsnt ways, pick the one you want to use.

Sub test()
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
ws.Columns("E").Value = ws.Columns("C").Value
End Sub


Sub test1()
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
ws.Columns("C:C").Copy
ws.Range("E1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
End Sub


Sub test2()
Dim lastrow As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
lastrow = ws.Cells(Rows.Count, "C").End(xlUp).Row
ws.Range("E1:E" & lastrow).Value = ws.Range("C1:C" & lastrow).Value
End Sub


--


Gary Keramidas
Excel 2003


"Jim Berglund" wrote in message
...
I get a 1004 error code that states that the PasteSpecial Method of Range
Class Failed with the following

Columns("C:C").Select
Application.CutCopyMode = False
Selection.Copy
Range("E1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Is there a way to fix this?

Jim


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 and pasting Pinny Excel Programming 1 January 7th 09 07:26 AM
pasting David Gerstman Excel Worksheet Functions 2 July 13th 07 08:02 PM
VBA Pasting RLang Excel Programming 1 November 10th 06 05:15 PM
Pasting on Filtered Data Sheets without pasting onto hidden cells CCSMCA Excel Discussion (Misc queries) 1 August 28th 05 01:22 PM
Pasting numbers and formulas without pasting format. Dan Excel Discussion (Misc queries) 3 March 27th 05 03:47 AM


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