View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Solve Using VBA Routine

Jim,

Determine the range
Find or insert a blank column adjacent to the range.
AutoFill the blank column with sequential numbers.
Sort the range (by Name then Amt). Include the sequential number column.
Loop thru the names, incrementing a counter in Column C.
When the name changes, start the counter over again.
Re-sort the range using the column with the autofilled numbers as the index.

Regards,
Jim Cone
San Francisco, USA


"Jim May" wrote in message news:HqRTd.18310$7z6.11048@lakeread04...
I have a table: A1:C11 as follows (Cells C2:C11 are Blank), but Macro
should fill in answer (given to the right):

Name Amt Order Answer to Order (=Rank ascending by Name)
Jon 13 ? 1
Jon 23 ? 3
Jon 15 ? 2
Peter 27 ? 2
Peter 10 ? 1
Alex 23 ? 2
Alex 34 ? 3
Alex 18 ? 1
Alex 36 ? 4
Mary 15 ? 1

The VBA routine should fill in C2:C11 with the above #'s
Can someone help me along?
TIA,