VBABEGINER
Well-known Member
- Joined
- Jun 15, 2011
- Messages
- 1,232
Hey Hi All,
Long time gone to loggon in Mrexcel. Actually now i able to atleast solve the basic requirements very well.
Thank You MrExcel.
Now i stuck in "Group By" syntax.
In col C there are 6 unique names that are -
lee
lee cooper
Peter
Peter england with Tie
Reebok
Nike shoe
But this is in multiple count that is
Nike shoe
lee
Reebok
Peter england with Tie
Nike shoe
lee cooper
Peter england with Tie
Peter
Nike shoe
Reebok
Peter england with Tie
Nike shoe
Reebok
Nike shoe
Peter england with Tie
I hope above get it. i.e- 1000 of records with this "6 scheme".
In col K I put -
col C..................col K
lee.....................1
lee cooper...........2
Peter..................3
Peter england with Tie......4
Reebok...............5
Nike shoe..........6
I sorted col K first and oredrised this ascending order.
Then now I am trying to grouping this names that is -
lee.....................1 comes first and all their item tags are listed in one below one
Now let me shoe my code
problem is i am totally unware about group by syntax.
So can any one kindly suggest?
Long time gone to loggon in Mrexcel. Actually now i able to atleast solve the basic requirements very well.
Thank You MrExcel.
Now i stuck in "Group By" syntax.
In col C there are 6 unique names that are -
lee
lee cooper
Peter
Peter england with Tie
Reebok
Nike shoe
But this is in multiple count that is
Nike shoe
lee
Reebok
Peter england with Tie
Nike shoe
lee cooper
Peter england with Tie
Peter
Nike shoe
Reebok
Peter england with Tie
Nike shoe
Reebok
Nike shoe
Peter england with Tie
I hope above get it. i.e- 1000 of records with this "6 scheme".
In col K I put -
col C..................col K
lee.....................1
lee cooper...........2
Peter..................3
Peter england with Tie......4
Reebok...............5
Nike shoe..........6
I sorted col K first and oredrised this ascending order.
Then now I am trying to grouping this names that is -
lee.....................1 comes first and all their item tags are listed in one below one
Now let me shoe my code
'code for number sorting
Range("A7:K400").Select
Selection.Sort Key1:=Range("K7"), Order1:=xlDescending, Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal
'code for name sorting
Range("A7:K400").Select
Selection.GroupBy:=lColName, Function:=xlSum, _
TotalList:=Array(iLengthCol, iLengthCol + 1, iLengthCol + 2, _
iLengthCol + 3, iLengthCol + 4, iLengthCol + 5), Replace:=True, PageBreaks:=False, _
SummaryBelowData:=True
problem is i am totally unware about group by syntax.
So can any one kindly suggest?