Automatically group rows based on cell value

Jd2023

New Member
Joined
Jun 28, 2023
Messages
18
Office Version
  1. 365
Platform
  1. Web
Hi all,

I would also like to automatically group rows together when a name is populated in column A?

Is that possible? Names would be, Sarah, Jane, Julie.

Thank you.

Kind Regards
Jasmine
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
If you want to group automatically, you can add a column of group name, and then sort by group as keyword.
 
Upvote 0
Yes but I would like this to happen automatically, as oppose to everytime I enter a name on a new row I have to sort.

Is this possible? That the row would automatically jump next to the rows with the same name enterered in collumn A?
 
Upvote 0
That requires VBA, which is not recommended as it will make the operation very strange
 
Upvote 0
Use this code in Private Sub Worksheet, adjusting its content references as you need. When you insert new names in column A, they should sort automatically in alphabetical order.
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
    Range("A2").Sort Key1:=Range("A3"), _
      Order1:=xlAscending, Header:=xlYes, _
      OrderCustom:=1, MatchCase:=False, _
      Orientation:=xlTopToBottom
End Sub

Book1.xlsm
ABC
1NameItem 1Item 2
2Jane1a1
3Jane2b2
4Jane3a2
5Julie4b3
6Julie5a3
7Julie6b4
8Julie7a4
9Julie8b5
10Mary9a5
11Sarah10b6
12Sarah11a6
Sheet1
 
Last edited:
Upvote 0
Solution

Forum statistics

Threads
1,216,129
Messages
6,129,046
Members
449,482
Latest member
al mugheen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top