View Poll Results: Where do you fgo for answers?

Voters
1. This poll is closed
  • websites

    1 100.00%
  • books

    0 0%
  • IT experts

    0 0%
  • EXCEL HELP

    0 0%
Multiple Choice Poll.
+ Reply to Thread
Results 1 to 3 of 3

Sorting related columns alphabetically

Hybrid View

  1. #1
    Registered User
    Join Date
    11-16-2010
    Location
    Manila
    MS-Off Ver
    Excel 2003
    Posts
    2

    Sorting related columns alphabetically

    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
    Attached Files Attached Files
    Last edited by DonkeyOte; 11-16-2010 at 07:59 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Sorting related columns alphabetically

    Ivan, welcome to the board - please note that CODE tags should be used at all times to encase any VBA you may post (however small).
    For more information about these and other tags, found here

    Given this is your first post I have on this occasion modified for you but going forward please ensure you familiarise yourself with the Forum Rules.

    Also please note the Poll you added is not relevant to the question and has been closed.
    If you wish to conduct a Poll of this nature please do so in an appropriate thread in an appropriate Forum (eg: "Water Cooler" Forum)

  3. #3
    Registered User
    Join Date
    11-16-2010
    Location
    Manila
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Sorting related columns alphabetically

    Thanks. I will from now on.

    Still can't figure out the code though

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1