Results 1 to 10 of 10

Selecting Ranges Based on Cells with same Values

Threaded View

  1. #9
    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

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