#1   Report Post  
Posted to microsoft.public.excel.programming
BDK BDK is offline
external usenet poster
 
Posts: 1
Default Macro Error

I'm using a macro to do a copy, paste special, transpose skip blank line and
repeat. I've used it in another worksheet and it worked fine. When I try
to use it in my current work sheet (I copied the macro to the new worksheet)
it gives me a run-time error 1004; copy area and paste area are not the same
shape and size.

If I make my selection smaller and then run the macro, it doesn't seem to
pick up on the blank lines inbetween each entry; therefore transposing my
data all onto ONE line.

Sub Blank ()
Dim myArea As Range

For Each myArea In Selection.SpecialCells(xlCellTypeConstants).Areas
myArea.Copy
Range("A25500").End(xlUp).Offset(1, 0) _
.PasteSpecial Paste:=xlAll, _
Operation:=xlNone, _
SkipBlanks:=False, _
transpose:=True
Next myArea

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Macro Error

hi,
check your code and make sure that you don't have any
absolute adresses in it.

-----Original Message-----
I'm using a macro to do a copy, paste special, transpose

skip blank line and
repeat. I've used it in another worksheet and it worked

fine. When I try
to use it in my current work sheet (I copied the macro to

the new worksheet)
it gives me a run-time error 1004; copy area and paste

area are not the same
shape and size.

If I make my selection smaller and then run the macro, it

doesn't seem to
pick up on the blank lines inbetween each entry;

therefore transposing my
data all onto ONE line.

Sub Blank ()
Dim myArea As Range

For Each myArea In Selection.SpecialCells

(xlCellTypeConstants).Areas
myArea.Copy
Range("A25500").End(xlUp).Offset(1, 0) _
.PasteSpecial Paste:=xlAll, _
Operation:=xlNone, _
SkipBlanks:=False, _
transpose:=True
Next myArea

End Sub

.

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
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Macro Run-time Error 1004 Application Defined or Object Defined Error Anddmx Excel Programming 6 June 9th 04 03:40 PM
Macro 'Automation error' with ChemOffice Excel macro Stew Excel Programming 0 October 27th 03 08:26 PM


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