+ Reply to Thread
Results 1 to 5 of 5

Getting run time error while copy / paste range

  1. #1
    Registered User
    Join Date
    10-16-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    31

    Getting run time error while copy / paste range

    Experts,

    What I am doing here is looping thru the cell in column C in line 35 and copying the value of the activity and pasting it in M9, and then I loop another and paste in the same cell using the "& Chr(10) &".
    This will basically do like this "A" & Chr(10) & "B" and will be shown one entry below other in the same cell - M9.

    This is basically a reminder program which will collect all unfinished tasks and collect in ONLY one cell - M9.
    The macro will execute on workbook_open event.

    The file is as attached.
    Attached Files Attached Files

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

    Re: Getting run time error while copy / paste range

    What is the purpse of this line

    range(CloumnNameActivity,0).Copy?

    If you want to copy the entire column C.
    use this line

    Columns(CloumnNameActivity).Copy

    or

    Range("C:C").Copy

  3. #3
    Registered User
    Join Date
    10-16-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Getting run time error while copy / paste range

    hello Ab33,
    I am just trying to copy the value which is given by
    Range(CloumnNameDate + RowNrString)

    on line 33, since that cell is the current selection and I was just trying diferent permutations to make the code work.
    Actually I meant Range((CloumnNameActivity).select.copy

  4. #4
    Registered User
    Join Date
    10-16-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Getting run time error while copy / paste range

    I managed to get the code working.
    Now I want only one thing..
    I want to paste all the values copied into One single cell: M9.

    PFA the file
    Attached Files Attached Files

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

    Re: Getting run time error while copy / paste range

    Your code has lots of selection and it will be prone to errors. Unless you are recording your actions, you should avoid using selection.
    In which line says you want to copy to M9?

    For example you could write these lines as

    Please Login or Register  to view this content.
    But which range do you want to copy?

+ 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. Run time error 1004 on picture copy and paste - excel 2010
    By talon10 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-15-2014, 08:14 PM
  2. Run time error: 1004 Paste special method of range class failed
    By amethystfeb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-23-2014, 02:04 AM
  3. [SOLVED] Run-Time Error - VBA Copy and Paste Multiple Row From One Workbook to Another
    By jxc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-27-2014, 03:47 PM
  4. Issue with copy and paste: Run-time error 438
    By tariq2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2013, 01:01 PM
  5. Copy-Paste cells from from 1 workbook to another: Run-time error '438'
    By Mon1aa in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-05-2012, 02:47 PM
  6. [SOLVED] macro error Copy Time format to other Worksheet and continues copy range
    By feroguz in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-25-2012, 01:30 PM
  7. Copy and paste cells to different range every time
    By johngr55 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-11-2009, 01:19 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