ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   paste special (https://www.excelbanter.com/excel-programming/331976-paste-special.html)

Ciara[_2_]

paste special
 
im getting a problem -

'Run-time error '1004':

Paste Special Method of Range Class failed

Problem code is

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

it works sometimes tho - basically the code opens up a workbook - adds a new
sheet and pastes the values into cell A1.

any ideas?

thanks,

Roger Whitehead

paste special
 
Are any of the cells you're copying, merged?


--
HTH
Roger
Shaftesbury (UK)

"Ciara" wrote in message
...
im getting a problem -

'Run-time error '1004':

Paste Special Method of Range Class failed

Problem code is

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

it works sometimes tho - basically the code opens up a workbook - adds a
new
sheet and pastes the values into cell A1.

any ideas?

thanks,




Ciara[_2_]

paste special
 
yes they are - if i do it manually it works but the code doesn't work? -
basically I paste special values and then paste special formats..... - i
dont' know why it won't work?

"Roger Whitehead" wrote:

Are any of the cells you're copying, merged?


--
HTH
Roger
Shaftesbury (UK)

"Ciara" wrote in message
...
im getting a problem -

'Run-time error '1004':

Paste Special Method of Range Class failed

Problem code is

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

it works sometimes tho - basically the code opens up a workbook - adds a
new
sheet and pastes the values into cell A1.

any ideas?

thanks,





Roger Whitehead

paste special
 
Try something like

For Each cel In Sheets(1).Range("A1:D5")
On Error Resume Next
Sheets(3).Range(cel.Address) = cel
Next

This will ignore merged cells


--
HTH
Roger
Shaftesbury (UK)


"Ciara" wrote in message
...
yes they are - if i do it manually it works but the code doesn't work? -
basically I paste special values and then paste special formats..... - i
dont' know why it won't work?

"Roger Whitehead" wrote:

Are any of the cells you're copying, merged?


--
HTH
Roger
Shaftesbury (UK)

"Ciara" wrote in message
...
im getting a problem -

'Run-time error '1004':

Paste Special Method of Range Class failed

Problem code is

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False

it works sometimes tho - basically the code opens up a workbook - adds
a
new
sheet and pastes the values into cell A1.

any ideas?

thanks,







George Nicholson[_2_]

paste special
 
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False


Is Selection a single cell or a range of cells?

--
George Nicholson

Remove 'Junk' from return address.


"Ciara" wrote in message
...
yes they are - if i do it manually it works but the code doesn't work? -
basically I paste special values and then paste special formats..... - i
dont' know why it won't work?

"Roger Whitehead" wrote:

Are any of the cells you're copying, merged?


--
HTH
Roger
Shaftesbury (UK)

"Ciara" wrote in message
...
im getting a problem -

'Run-time error '1004':

Paste Special Method of Range Class failed

Problem code is

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False

it works sometimes tho - basically the code opens up a workbook - adds
a
new
sheet and pastes the values into cell A1.

any ideas?

thanks,








All times are GMT +1. The time now is 10:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com