Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default runtime error 1004


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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default runtime error 1004

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

"Adella" wrote in message
...

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default runtime error 1004

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

"Adella" wrote in message
...

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


.

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
Runtime Error 1004 JB Bates[_2_] Excel Discussion (Misc queries) 5 December 29th 09 02:40 PM
runtime error 1004 valdesd Excel Discussion (Misc queries) 0 October 12th 05 05:30 PM
runtime error 1004 valdesd Excel Discussion (Misc queries) 2 October 12th 05 03:20 PM
Another runtime 1004 error [email protected] Excel Discussion (Misc queries) 2 September 17th 05 09:21 AM
Runtime Error '1004' [email protected] Excel Discussion (Misc queries) 2 July 18th 05 06:10 AM


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