Q.1

  • Thread starter Thread starter kbee
  • Start date Start date
K

kbee

how to format a cell in a 'sorting column' so that every time i put an entry
in the cell it will be sorted in its right position- in the column, i guess
it need to be after I finish entering all the other cells in the row? how
please?
thanx,
bee
 
If you are entering more than one now then wait and just use a regular sub.
Record a macro to see what is happening and then post back with more info
and your efforts. IF?? you are only entering ONE at this time then use a
worksheet_change event within the sheet module. Examples would be helpful.
 
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim rng As Range
Set rng = Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
If Target.Column <> 6 Then Exit Sub
Application.ScreenUpdating = False
ActiveCell.CurrentRegion.Select
With Selection
.Sort Key1:=Range("C2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End With
rng.Select
Application.ScreenUpdating = False
End Sub

Will sort the currentregion by column C when you enter out last cell of column F

Adjust to suit.

Right-click on the sheet tab and "View Code".

Copy/paste into that module.


Gord Dibben MS Excel MVP
 
One caveat with type of autosorting is................

If you misspell an entry the sorting takes place and you may have a problem
finding the misspelled entry.


Gord
 
Back
Top