Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to store a list of names in my spreadsheet. I will probably
use the range of A1 to A? to save my name list. Here's a small example: A1 = "Anderson, Tom" A2 = "Baker, Richard" A3 = "Foley, Bob" A4 = "Peterson, Zack" I will be adding new names to this list every day, so it is NOT a fixed size list. Suppose tomorrow I need to add "Carlson, Amanda" to the above list. The ideal sorted list will be: A1 = "Anderson, Tom" A2 = "Baker, Richard" A3 = "Carlson, Amanda" A4 = "Foley, Bob" A5 = "Peterson, Zack" Does anyone know how to write a VBA "insert and sort" function that achieves the above task? I am not interested in Excel's built-in sort features....I would like to accomplish this with VBA code that sorts or re-arranges a range of strings in cells. It seems to be a matter of finding where the new name fits in the last, and then pushing all the other names down by one cell. The function/sub template might look approximately like this: Public Sub InsertAndSort (NameBegin as Range, NameFinal as Range, NameToAdd as String) ' ' Sort code ' End Sub I would really appreciate any ideas on how to achieve this. Thank you! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Quick method to sort a list of strings? | Excel Programming | |||
Use Formula to sort two strings | Excel Worksheet Functions | |||
macro code to sort a range | Excel Discussion (Misc queries) | |||
Sort a row of strings, some containing blanks | Excel Programming | |||
Replacing VBA code strings by using VBA code? | Excel Programming |