+ Reply to Thread
Results 1 to 4 of 4

Clear merged and non-merged cells in named range.

  1. #1
    Registered User
    Join Date
    02-16-2018
    Location
    WI
    MS-Off Ver
    2016
    Posts
    56

    Clear merged and non-merged cells in named range.

    Hello once again.

    I have a named range which is populated by a userform, so I would like to clear all cells in the range before re-populating them each time. This is straightforward, and of course fails with merged cells in the range.

    Name of the range is "TemplateData", located on Sheet1.

    Solutions? Aside from getting rid of the merged cells, as much as I would like to. Clearing them individually would be painful.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Clear merged and non-merged cells in named range.

    Preumably with a VBA macro line

    Please Login or Register  to view this content.
    When you've done that I suggest you unmerge all the cells. Most of us avoid them like the plague since they just cause too many problems with various aspects of Excel & VBA.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    02-16-2018
    Location
    WI
    MS-Off Ver
    2016
    Posts
    56

    Re: Clear merged and non-merged cells in named range.

    That macro fails on merged cells.

    I don't like them either, I assure you, however I only have one function that interacts poorly with them. Filling them works fine.

    I suppose I can probably fake it with the overlap of the text spilling into the next cell to the right. I will attempt this now. The only problem is I have a couple of cells which must contain multiple lines of text as they are "notes" of the process.

    If they can be cleared individually that would be fine too.

  4. #4
    Registered User
    Join Date
    02-16-2018
    Location
    WI
    MS-Off Ver
    2016
    Posts
    56

    Re: Clear merged and non-merged cells in named range.

    Doing a single cell and letting the text spill over seems to be working fine thus far but I still have 3 merged cells which must be dealt with in order to display things properly.

    Update again: "Center across selection" after selecting multiple cells and formatting them solved my alignment concern without merged cells however this cannot apply to a block of merged cells required for further text.

    I have changed these "notes" sections to textboxes instead. Problem sorted.

    For anyone else stumbling across this thread, note that .Clear removes formatting of cells on a worksheet and .Clearcontents removes only the cells.. well, contents.

    Update again: "Center across selection" merges all neighboring cells with this value set, even if they are selected and set independently. Need another cell between the selections to prevent this.
    Last edited by IMM Tech; 02-20-2018 at 03:36 PM.

+ 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. Replies: 1
    Last Post: 10-22-2016, 04:27 AM
  2. [SOLVED] Sort by named range or blocks of data with merged cells?
    By donkey33 in forum Excel Formulas & Functions
    Replies: 31
    Last Post: 08-11-2016, 08:47 AM
  3. Replies: 0
    Last Post: 11-25-2014, 07:08 AM
  4. automatically fit an image into merged cells for full width of merged cells
    By Marcin4111 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-18-2014, 03:12 PM
  5. Replies: 1
    Last Post: 06-28-2012, 11:53 AM
  6. how do i link merged cells to a merged cell in another worksheet.
    By ibbm in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-27-2006, 06:45 PM
  7. Clear Contents won't work on merged cells
    By ArthurJ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-20-2006, 01:25 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