LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,059
Default Looking for a formula that will convert IP address for sorting

On Jan 6, 10:54*am, I wrote:
use the following macro (making sure the range in B is still selected):


On second-thought, I think this is easier to use as a function. Enter
the function below according to the instructions in my previous
posting. Then, if A1 contains the IP address in dot-notation, put the
following into B1:

=convertIP(A1)

The function is:

Function convertIP(c) As String
ip = Split(c, ".", 4)
For i = 0 To 3
Select Case Len(ip(i))
Case 1: ip(i) = "00" & ip(i)
Case 2: ip(i) = "0" & ip(i)
Case Else
End Select
Next i
convertIP = Join(ip, ".")
End Function
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Function to convert to email address? [email protected] Excel Worksheet Functions 4 November 12th 07 08:39 PM
Convert Relative to absolute address Yorke Excel Discussion (Misc queries) 6 October 25th 07 07:47 PM
how can i convert an email address to a web address Arvind Sikar Excel Worksheet Functions 3 October 3rd 06 08:06 PM
Sorting IP Address ggant Excel Discussion (Misc queries) 12 November 28th 05 05:53 PM
Sorting an Address List steve_g Excel Worksheet Functions 4 June 17th 05 06:36 PM


All times are GMT +1. The time now is 05:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"