+ Reply to Thread
Results 1 to 8 of 8

Code not working - copy and paste.

  1. #1
    Registered User
    Join Date
    05-14-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    50

    Code not working - copy and paste.

    Hi Guys,

    I'm trying to copy data from one sheet to another sheet but keeps coming up with End or Debug.

    I want it to copy the data from Sheet Data Range A2 and E2 down to the last cell with a value in it. then copy to sheet 0209 and paste in A6

    I'm looking to avoid using the clipboard to copy and paste.

    Code I have:

    Please Login or Register  to view this content.
    Any help would be appreciated

    Thanks

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Code not working - copy and paste.

    I believe your Range parameters need to be separated by a colon ":" not a comma ","....I believe
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Code not working - copy and paste.

    Maybe

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-14-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Code not working - copy and paste.

    If i separate them by ':' it will copy columns A2 to E2 all i'm after is Column A2 and E2 thats why i thought a ',' would work.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Code not working - copy and paste.

    Amended following update

    Please Login or Register  to view this content.
    Last edited by AB33; 09-03-2014 at 03:00 PM.

  6. #6
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Code not working - copy and paste.

    Looks like mrice's code should work if you change the his colons to comma's...

  7. #7
    Registered User
    Join Date
    05-14-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Code not working - copy and paste.

    Just tried that and I get

    Run-Time error '9':

    Subscript out of range

    End | Debug.

    tried with the : and with the ,

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Code not working - copy and paste.

    Did you try my code?
    Error 9 means one of the sheets names is wrong. You need to check the sheet names exist on the workbook you are working.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Code to copy and paste cell value from last used row to new row not working
    By figbash in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-11-2014, 02:02 PM
  2. [SOLVED] Code to copy and paste not working
    By missit in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-13-2014, 10:27 PM
  3. [SOLVED] Copy & Paste Code not working second time around?
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-10-2013, 05:08 PM
  4. Code: Find, Copy, Paste not working
    By ufopilot3 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-26-2012, 03:40 PM
  5. VBA Copy Paste Code not Working...
    By geng in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2010, 10:30 PM

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