Looking for a macro

  • Thread starter Thread starter gmangad
  • Start date Start date
G

gmangad

A B C
D
1 Name Tel no Name
Tel no

2 Aashiq 6540029 Dawoodi 2402582

3 Fakhri 2438362 Aashiq 9809748

4 Fatemi 2448319 Abbas 7993640

5 Hozefa 2416985

6 Kutabi 2451009

THE ABOVE IS A SAMPLE DATA
Cell (A&B) is one group and (C&D) is another group.

Imagine, more datas will be added daily in each group. and I need a
macro to run so the it will identify automatically the last row of
each group and it is has to be sorted by name.

Hope someone help me.
Thanks in Advance
GT
 
Morning GT,

This should do it

Dim rng As Range

Set rng = Range("A1").Resize(Range("A1").End(xlDown).Row, 2)
rng.Sort key1:=Range("A1"), header:=xlYes

Set rng = Range("C1").Resize(Range("C1").End(xlDown).Row, 2)
rng.Sort key1:=Range("C1"), header:=xlYes


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top