+ Reply to Thread
Results 1 to 4 of 4

not keeping the merged cells in a copy, paste code.

  1. #1
    Registered User
    Join Date
    05-16-2021
    Location
    USA
    MS-Off Ver
    10
    Posts
    4

    not keeping the merged cells in a copy, paste code.

    I have two areas where I have merged cells but the marco I'm using to copy paste in another row and clear the contents isn't keeping the merged cells or formula. The first code has merged cells C to G and formula in the "J" cell of =H*I but when it copies and inserts a new row it isn't merging the cells in column C to G nor putting the formula back into cell in the "J" column.
    Please Login or Register  to view this content.
    the other table has merged cells D to H but when it copies the last row and inserts it, it unmerges the D to H cells.
    Sub Itemsaddrow()

    Please Login or Register  to view this content.
    I can't use a specific row number because data is always having new row inserted above these two areas.
    Any help would be great to get the merge cells to stay merged.
    Last edited by alansidman; 05-23-2021 at 09:18 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,913

    Re: not keeping the merged cells in a copy, paste code.

    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,913

    Re: not keeping the merged cells in a copy, paste code.

    https://www.officearticles.com/excel...soft_excel.htm

    Take a look at this site and learn about the evils of merged cells

  4. #4
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: not keeping the merged cells in a copy, paste code.

    You could try merging the cells after pasting...
    Please Login or Register  to view this content.

+ 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. [SOLVED] How can I copy and paste merged cells?
    By FvdF in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-25-2020, 09:28 AM
  2. Merged cell error on copy/paste, but no merged cells
    By OmniBlue in forum Excel General
    Replies: 3
    Last Post: 07-15-2019, 02:15 PM
  3. Copy and paste all rows of merged cells
    By Madz0220 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-23-2017, 09:56 AM
  4. Copy cells and paste into a merged cell
    By dontke in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-20-2015, 11:06 AM
  5. [SOLVED] copy/paste to merged cells
    By tomanton in forum Excel General
    Replies: 10
    Last Post: 10-17-2013, 09:28 AM
  6. copy/paste formulas across merged cells?
    By juanzo007 in forum Excel General
    Replies: 2
    Last Post: 11-25-2010, 11:09 PM
  7. Macro to Add Row and Copy/Paste Merged Cells
    By dipitududa2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-02-2006, 09:35 AM

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