Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA and pasting | Excel Programming | |||
pasting | Excel Worksheet Functions | |||
VBA Pasting | Excel Programming | |||
Pasting on Filtered Data Sheets without pasting onto hidden cells | Excel Discussion (Misc queries) | |||
Pasting numbers and formulas without pasting format. | Excel Discussion (Misc queries) |