+ Reply to Thread
Results 1 to 4 of 4

Merged Cell Problems

  1. #1
    Forum Contributor
    Join Date
    11-21-2017
    Location
    USA
    MS-Off Ver
    2016
    Posts
    150

    Merged Cell Problems

    To avoid merging cells (because I need to run a number of sort and sum functions for the given column) I quick wrote a work around that would treat a range of cells as though it was merged without actually merging them.

    Please Login or Register  to view this content.
    I then center across AH1:AM1. While it works great, I encountered a couple of problems:

    Problem 1: Say for example I want to select range A1:AS39 to copy and paste. Since AH1:AM1 is in that range it will move the cursor to AH1 every time. Is there a way around that problem? I need it such that if any cell outside the range set is selected it disregards the code.
    Problem 2: How do I keep this code simple, but apply it to every row in the columns I outlined? Not just for AH1:AM1 but for every row (AH2:AM2, AH3:AM3, etc.)

    If you have a better way of handling merged cells, please let me know!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Merged Cell Problems

    Merged cells can cause problems, particularly in VBA, so the decision to not use merged cells is a good one.

    This will change the selection to column AH of the selected row if and only if the entire selection is within columns AH:AM. It will not do anything if the user selects more than one row; not sure what you want to happen in that case.

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    11-21-2017
    Location
    USA
    MS-Off Ver
    2016
    Posts
    150

    Re: Merged Cell Problems

    Thanks. That did the trick.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Merged Cell Problems

    You're welcome! Thanks for the rep, and thanks for marking your thread Solved!

+ 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] Userform problems with merged worksheet cells
    By Lukael in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 06-01-2014, 04:39 PM
  2. Limit merged cell data; Place excess into next merged cell down
    By coreytroy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2013, 10:35 PM
  3. Problems with loop and cells merged
    By sylvain133 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-18-2013, 06:03 AM
  4. [SOLVED] VB:ClearContents Error on Merged Cell - But I dont have Any Merged Cell
    By cychua in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-24-2013, 06:33 AM
  5. Replies: 6
    Last Post: 05-18-2012, 06:30 AM
  6. [SOLVED] Copy merged cell, paste as merged cell
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-18-2009, 02:35 PM
  7. 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

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