runtime error 1004

A

Adella

I am using the following code to open a file and copy data
to another file. There are some cells that have merged
cells which is creating a runtime error 1004 this operation
requires the merged cells to be identically sized. I
originally tried to copy a bigger range with the same
formats but that didn't work either. Does anyone have any
suggestions?

Thanks.

Dim schb2 As Range
Workbooks(myfile).Activate
Worksheets("Schedule B-2 By Premium Group").Visible =
True
Worksheets("Schedule B-2 By Premium Group").Activate
Set schb2 = Worksheets("Schedule B-2 By Premium Group
").Range("d13:d811")
schb2.Copy
Worksheets("Schedule B-2 By Premium Group").Visible =
False
ThisWorkbook.Activate
Sheet7.Activate
Sheet7.Cells(13, 4).PasteSpecial Paste:=xlPasteValues
 
S

steve

Adella,

I am sure there is an easier way, but doing a regular paste, unmerge, copy,
paste value will work.

ActiveSheet.Paste
Application.CutCopyMode = False
With Selection
.MergeCells = False
End With
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False

steve
 
A

Adella

Thanks!
-----Original Message-----
Adella,

I am sure there is an easier way, but doing a regular paste, unmerge, copy,
paste value will work.

ActiveSheet.Paste
Application.CutCopyMode = False
With Selection
.MergeCells = False
End With
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:= xlNone, SkipBlanks:=
_
False, Transpose:=False

steve

xlPasteValues


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top