Results 1 to 6 of 6

paste into merged cells

This is a discussion on paste into merged cells within the Excel Questions forums, part of the Question Forums category; This code caused a run time error 1004: paste method of worksheet class failed: Code: Range("N1").Copy ActiveSheet.Paste Destination:=Range("AA58") AA58 is ...

  1. #1
    Board Regular
    Join Date
    May 2010
    Location
    victoria, canada
    Posts
    403

    Default paste into merged cells

    This code caused a run time error 1004: paste method of worksheet class failed:
    Code:
    Range("N1").Copy
    ActiveSheet.Paste Destination:=Range("AA58")
    AA58 is actually the leftmost cell of some merged cells; I changed it to the following
    Code:
    Range("N1").Copy
    Range("AA58").Select
    ActiveSheet.Paste
    and it runs fine.
    My question is this: is there a way to paste into the merged cells without selecting them?
    Thanks
    David

  2. #2
    Board Regular jbeaucaire's Avatar
    Join Date
    May 2002
    Location
    Bakersfield, CA
    Posts
    5,745

    Default Re: paste into merged cells

    When dealing with merged cells, best to use the .value method:

    Code:
    Range("AA58").Value = Range("N1").Value
    Microsoft MVP 2010 - Excel
    Jerry Beaucaire's Excel Tools

    "Actually I *am* a rocket scientist." -- JB

  3. #3
    Board Regular
    Join Date
    May 2010
    Location
    victoria, canada
    Posts
    403

    Default Re: paste into merged cells

    will this create a link or just copy the value?

  4. #4
    Board Regular
    Join Date
    Feb 2009
    Location
    Massachusetts, USA
    Posts
    1,777

    Default Re: paste into merged cells

    The following should also work.

    Gary

    Code:
    Range("N1").Copy
    ActiveSheet.Paste Destination:=Range("AA58").MergeArea
    Murphy's Fifth Law: If anything absolutely can NOT go wrong, it will anyway.

  5. #5
    Board Regular
    Join Date
    May 2010
    Location
    victoria, canada
    Posts
    403

    Default Re: paste into merged cells

    Please allow me to withdraw the previous dumb response. I tried your suggestion and it worked beautifully.

  6. #6
    Board Regular
    Join Date
    May 2010
    Location
    victoria, canada
    Posts
    403

    Default Re: paste into merged cells

    Both suggestions worked beautifully. Thanks!

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com