+ Reply to Thread
Results 1 to 7 of 7

VBA to return the column numbers of the start and finish of a merged cell? RANDOM!

  1. #1
    Registered User
    Join Date
    05-31-2013
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    83

    Red face VBA to return the column numbers of the start and finish of a merged cell? RANDOM!

    I know this seems like a random one! but I have a really long merged cell called "Model Length". it can vary as to where it is on the sheet. what I want to do is return two variables one containing the column number of the start of the merged cell, the other to return the column number of the end of the merged cell.

    I currently have
    Please Login or Register  to view this content.
    Which returns a list of all the cells in the merged cell but I cant figure out how to identify the start and finish points.

    Please help

    thanks

    Jim

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: VBA to return the column numbers of the start and finish of a merged cell? RANDOM!

    Jim,

    One way...
    Please Login or Register  to view this content.
    Last edited by tigeravatar; 06-28-2013 at 12:12 PM.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: VBA to return the column numbers of the start and finish of a merged cell? RANDOM!

    Jim,

    another way

    Please Login or Register  to view this content.
    Please click the * below if this helps
    Please click the * below if this helps

  4. #4
    Registered User
    Join Date
    05-31-2013
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    83

    Re: VBA to return the column numbers of the start and finish of a merged cell? RANDOM!

    Awsome thanks tigeravatar and JasperD.

    is there anyway to actually specify the merged cell that contains the text "model life" only? as if there are other merged cells it returns those values as well?

    thanks

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: VBA to return the column numbers of the start and finish of a merged cell? RANDOM!

    So you would only want information regarding merged cells that contain the text "model life"?
    Please Login or Register  to view this content.
    Btw, the reason I like the .Find method is because it won't waste time looking at cells that are not merged.

  6. #6
    Registered User
    Join Date
    05-31-2013
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    83

    Re: VBA to return the column numbers of the start and finish of a merged cell? RANDOM!

    nailed it thanks tigeravatar. tbh I thought yours was a little long winded but actually yours is far more efficient just took a little while to get my head around!

    thanks your a star

  7. #7
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: VBA to return the column numbers of the start and finish of a merged cell? RANDOM!

    You're very welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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