title: Grouping rows with same value in VBA
body: <p>I have a table in excel and I want to create a Macro in VBA to <strong>group rows with the same Value</strong> in Column F and highlight the title group in bold. </p>
  
  <p>In other words, All the rows with the same value in Column F, must be group in one row with the tittle in bold. Its possible?</p>
  
  <p>This is what I have:<br>
  <a href="https://i.stack.imgur.com/ADXx7.png" rel="nofollow noreferrer">Actual Data</a></p>
  
  <pre><code>    Dim r As Range
      Dim v As Variant
      Dim i As Long, j As Long
  
      With ActiveSheet
          On Error Resume Next
          ' expand all groups on sheet
          .Outline.ShowLevels RowLevels:=8
          ' remove any existing groups
          .Rows.Ungroup
          On Error GoTo 0
          Set r = .Range("F1", .Cells(.Rows.Count, 6).End(xlUp))
          r.Select
      End With
  
      With r
          j = 1
          v = .Cells(j, 1).Value
          For i = 2 To .Rows.Count
              If v &lt;&gt; .Cells(i, 1) Then
                  ' Colum B changed, create group
                  v = .Cells(i, 1)
                  If i &gt; j + 1 Then
                      .Cells(j + 1, 1).Resize(i - j - 1, 1).Rows.Group
                  End If
                  j = i
                  v = .Cells(j, 1).Value
              End If
          Next
          ' create last group
          If i &gt; j + 1 Then
              .Cells(j + 1, 1).Resize(i - j - 1, 1).Rows.Group
          End If
          ' collapse all groups
          .Parent.Outline.ShowLevels RowLevels:=1
      End With
  </code></pre>
  
  <p>This is what I want: </p>
  
  <p><img src="https://i.stack.imgur.com/CkaQz.png" alt="Expected Data"></p>
  
  <p>Thanks so much, I'll be very greatful</p>