+ Reply to Thread
Results 1 to 10 of 10

Selecting Ranges Based on Cells with same Values

Hybrid View

  1. #1
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Selecting Ranges Based on Cells with same Values

    try it
    Sub ert()
    Dim i&, r As Range
    Application.ScreenUpdating = False
    For i = 4 To Cells(Rows.Count, 1).End(xlUp).Row
        Set r = Cells(i, 1)
        Do While Cells(i, 1) = Cells(i + 1, 1)
            Set r = Union(r, Cells(i + 1, 1))
            i = i + 1
        Loop
        r.Offset(, 8).Merge: r.Offset(, 9).Merge
    Next i
    Application.ScreenUpdating = True
    End Sub
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    04-16-2012
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Selecting Ranges Based on Cells with same Values

    Brilliant!!

    Works perfectly apart from the merge cells warning about upper left data only and an error when it completes but that's not a big deal for me.

    Thanks so much for yo

+ 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