+ Reply to Thread
Results 1 to 7 of 7

Select a Range of Cells Offset from a Selected Merged cell

  1. #1
    Registered User
    Join Date
    02-05-2013
    Location
    Phoenix
    MS-Off Ver
    Excel 2010
    Posts
    4

    Select a Range of Cells Offset from a Selected Merged cell

    Hey Guys,

    Having some trouble here, I'm sure this isnt too difficult.

    I want to select a merged cell that is a range of cells in a column, and select the adjacent cells 4 columns over.
    So I found this, but I need it to use the selected merged cell to get the range, not a static merged cell name. Cant seem to figure this out.

    ActiveSheet.Range("Test").Offset(0, 4).Select

    Thanks so much!

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Select a Range of Cells Offset from a Selected Merged cell

    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Select a Range of Cells Offset from a Selected Merged cell

    The following code finds your named range and selects a cell four columns to the right of that range.


    Please Login or Register  to view this content.
    This code does the same for range g13

    Please Login or Register  to view this content.
    This does the same for the cell defined by the variables RowNo and ColNo

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    02-05-2013
    Location
    Phoenix
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Select a Range of Cells Offset from a Selected Merged cell

    Thanks for the reply guys!

    I may have not been clear, I want the starting range to be a merged cell that I currently have selected on the sheet. So say, I select merged cell A71, which is actually A71-A90 Then I want to hit a macro and cells E71-E90 are selected, and so on.

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Select a Range of Cells Offset from a Selected Merged cell

    MR=Range("A1").mergearea.Rows.Count
    Range("A1").Offset(0,4).Resize(MR,1).Select

  6. #6
    Registered User
    Join Date
    02-05-2013
    Location
    Phoenix
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Select a Range of Cells Offset from a Selected Merged cell

    Quote Originally Posted by protonLeah View Post
    MR=Range("A1").mergearea.Rows.Count
    Range("A1").Offset(0,4).Resize(MR,1).Select
    Awesome! that works for the merged cell range, now my only question is, how do I have it use the selected cell instead of just "A1" ?

    Thank you so much

  7. #7
    Registered User
    Join Date
    02-05-2013
    Location
    Phoenix
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Select a Range of Cells Offset from a Selected Merged cell

    Actually I just figured it out, this is what finally solved my issue. THANKS for your help!!

    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)

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