Hello everyone.
It's good i stumbled upon this website. i learned a lot using excel with this site.
I need help on the following matter.
I have a workbook that contains a sheet with a source list of ingredients with their corresponding prices and packaging criteria. This source list supports another workbook which calculates recipe costs.
I need to find a code or something that would allow the list to arrange alphabetically automatically by the first column which contains the ingredient name. End result should be that whenever I add a new ingredient to the source list, the list would arrange automatically and it's corresponding prices and packaging will follow suit.
i have searched throughout the forums but the codes i get only rearranges the new items. For example, the following code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Check that cell changed was in col E. If not, exit.
If Target.Column <> 5 Then Exit Sub
'Sort cells alphabetically a:e by col a ascending. Presumes header in row 1
Range("A2:E1000").Sort Key1:=Range("e1"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub
...works, but after entering the last data it would jump to the top of the list instead of rearranging the entire list. I have been trying several codes, but this is the closest. I have attached the worksheet for your reference.
Please help. i need this done. i would be very grateful
Ivan
Bookmarks