Consulting

Results 1 to 2 of 2

Thread: Copy & Paste

  1. #1
    VBAX Newbie
    Joined
    Mar 2019
    Posts
    1
    Location

    Copy & Paste

    This should be super simple, but it is not working:

    Sub CopyPaste()
    
    Dim a As Workbook
    Dim b As Workbook
    
    Set a=Workbooks.Open("File Location")
    Set b=Workbooks.Open("File Location")
    
    a.Sheets("Division Chart").Cells.Copy
    b.Sheets("Division Chart").Cells.PasteSpecial xlPasteValues
    
    End Sub
    I'm getting an error in the final step when it is trying to paste.

    Error: All merged cells must be the same size (but the sheets are exact copies of each other..)

    What's wrong? Thanks

  2. #2
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    613
    Location
    .
    Have you tried "unmerging" the cells (both workbooks) to see if the macro works ?

Posting Permissions

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