Past Tip of the Day
Two tips today, and the day is already young... Russell has a column of internal IP addresses and he want to sort them. The problem is that the .100. addresses are coming before the .22. addresses.
If Russell adds a new, temporary column to be used for sorting, he can use this new custom function IPForSort(). This code should be pasted into a code module in the workbook.
Public Function IPforSort(OrigVal)
IPforSort = ""
OrigVal = OrigVal & "."
Bg = 1
For i = 1 To Len(OrigVal)
If Mid(OrigVal, i, 1) = "." Then
IPforSort = IPforSort & Format(Mid(OrigVal, Bg, i - Bg), "000") & "."
Bg = i + 1
IPforSort = Left(IPforSort, Len(IPforSort) - 1)
By Bill Jelen on 01-Nov-2001
MrExcel.com Consulting can be hired to implement this concept, or many other cool applications, with your data.
MrExcel.com provides examples of Visual Basic procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The Visual Basic procedures on this web site are provided "as is" and we do not guarantee that they can be used in all situations.
Excel is a registered trademark
of the Microsoft® Corporation.
All contents Copyright
1998-2008 by MrExcel Consulting.