+ Reply to Thread
Results 1 to 5 of 5

Getting the Address of a merged cell

  1. #1
    Registered User
    Join Date
    11-26-2007
    Posts
    23

    Getting the Address of a merged cell

    Hello,

    how would you return the full range address of a merged cell?

    right now it only returns the top left cell of the merged cells.

    Like for example you merge cells A1, A2, A3 and A4
    Then you try to get the address, and it returns "A1".
    How would you get it to return "A1:A4" ?
    Last edited by dude2007; 06-18-2008 at 07:39 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Don't think you can do that from the user interface. From VBA,
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-26-2007
    Posts
    23
    thank you, this worked well!

    i have one more question though:

    say you have A3 to A18 as a merged cell.

    When you use this:
    MsgBox ActiveCell.MergeArea.Address

    it returns "$A$3:$A$18"

    How would you get the values "3" and "18" separated out of the above? (I just want to get the row values for the range...)


    Thank you again!!

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Dude, please read the Forum Rules and then get religion about using Code Tags.

    Please Login or Register  to view this content.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello shg,

    You were close on the row calculations. Provided the merged area is contiguous, the calculations would be...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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