+ Reply to Thread
Results 1 to 7 of 7

Code to copy columns not working

  1. #1
    Registered User
    Join Date
    07-04-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    54

    Code to copy columns not working

    Hi Excel Forum gurus,

    I'm having a second go, from a different angle, at a problem I posted on here about at the end of last week - I got it to do what I wanted, but the macro was taking well over 5 minutes to run, a time for the task that I couldn't really handle.

    Anyway, I've come up with a different, much more efficient method, but the code I've come up with doesn't seem to be working. If someone can spot the obvious error before I start uploading more workbooks, that would be fantastic!

    Thanks again.
    Please Login or Register  to view this content.
    Last edited by Authentik8; 07-09-2012 at 07:31 AM.

  2. #2
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: Code to copy columns not working

    Hi,

    Change this

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    What you where doing was passing the range an integer when you should pass it the value from the columns array
    Please take time to read the forum rules

  3. #3
    Registered User
    Join Date
    07-04-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: Code to copy columns not working

    Hi, thanks for the quick reply, but now it gives me an error message, and highlights the colon in
    Please Login or Register  to view this content.
    : "Compile error: Expected: list separator or )" - Not sure what's going on, I just copied and pasted to the appropriate part of the code?

  4. #4
    Registered User
    Join Date
    07-04-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: Code to copy columns not working

    Ok, I managed to sort one element of the problem, but have run headlong into another. The uploader is saying my file is too large to upload I'm afraid.
    The current code is
    Please Login or Register  to view this content.
    Last edited by Authentik8; 07-09-2012 at 07:58 AM.

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Code to copy columns not working

    You might like to try telling people what is actually going wrong rather than leaving them to guess...
    Remember what the dormouse said
    Feed your head

  6. #6
    Registered User
    Join Date
    07-04-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: Code to copy columns not working

    I was trying to upload an excel file to illustrate it better than I could describe, but the forum attachment uploader isn't letting me. :@ Basically, It just pastes row upon row of the headers of the column, right down to the row limit of the spreadsheet.
    Last edited by Authentik8; 07-09-2012 at 08:04 AM.

  7. #7
    Registered User
    Join Date
    07-04-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: Code to copy columns not working

    Not to worry, all solved in the end. Sorry to trouble you all.
    Please Login or Register  to view this content.
    Works and does exactly what I want it to.

+ 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