+ Reply to Thread
Results 1 to 4 of 4

ip macro

Hybrid View

  1. #1
    Registered User
    Join Date
    08-11-2008
    Location
    us
    Posts
    5

    ip macro

    I also am having a hard time with ipaddresses. I have thousands of these to work on.

    I need to change the last number from a 1 to a 0

    192.62.131.1
    192.62.133.1
    192.62.134.1
    192.62.136.1
    192.62.140.1
    192.62.141.1
    192.62.143.1

    needs to be
    192.62.131.0
    192.62.133.0
    192.62.134.0
    192.62.136.0
    192.62.140.0
    10.62.141.0
    10.62.143.0

    find .1 replace with .0 returns

    192.62.031.0
    192.62.033.0
    192.62.034.0
    192.62.036.0
    192.62.040.0
    192.62.041.0
    192.62.043.0

    Any ideas?

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481
    With formula in an adjacent cell you could use

    =LEFT(A1,LEN(A1)-1)&"0"
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    10-20-2008
    Location
    India
    Posts
    8
    temp = "192.62.131.1"
    temp1 = Right(temp, Len(temp) - InStrRev(temp, ".", -1))

    temp2 = Left(temp, InStrRev(temp, ".", -1))
    If Left(temp1, 1) = "1" Then
    temp1 = "0" + Right(temp1, Len(temp1) - 1)
    temp = temp2 + temp1
    End If
    MsgBox temp

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hemant Dhodiya,

    This is the 2nd warning about not using code tags. Please don't ignore my request to add you're code tags as per forum rules below

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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