View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff[_2_] Harald Staff[_2_] is offline
external usenet poster
 
Posts: 449
Default Remove digits after colon

The Excel solution:

Data Text to columns, Delimited, set colon as delimiter.

The programming solution:

Sub Kill()
Dim Cel As Range
Dim S() As String
For Each Cel In Selection
S = Split(Cel.Value, ":")
Cel.Value = S(0)
Next
End Sub

HTH. Best wishes Harald

"astral" wrote in message
...
how to parse list of IPs and delete all digits after the colon (include
":" )?

have:
121.12.249.207:1080
187.4.205.153:1080
188.193.79.13:17040
222.174.72.38:1080

need parse and get just IP list, without ":1080", .i.e.


121.12.249.207
187.4.205.153
188.193.79.13
222.174.72.38