+ Reply to Thread
Results 1 to 2 of 2

Macro Error: macro to do a copy

  1. #1
    BDK
    Guest

    Macro Error: macro to do a copy

    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. #2
    Guest

    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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1