+ Reply to Thread
Results 1 to 4 of 4

search for text, then search for previous text, replace 1st text including number from 2nd

  1. #1
    Registered User
    Join Date
    09-10-2012
    Location
    Zanesville, OH
    MS-Off Ver
    Excel 2010
    Posts
    8

    search for text, then search for previous text, replace 1st text including number from 2nd

    Need macro to:
    search for "standby ip"
    search for previous interface vlan number
    replace "standby ip" with "vrrp vrid (vlan number) virtual-ip"

    Sample
    .............................................
    !
    interface Vlan722
    description Connection to t1010
    ip address 10.89.59.3 255.255.255.0
    ip helper-address 10.58.134.6
    ip helper-address 10.61.134.6
    ip helper-address 10.58.142.6
    no ip redirects
    standby ip 10.89.59.1
    standby timers 1 3
    standby priority 105
    standby preempt delay minimum 3 sync 3
    !
    interface Vlan723
    description Connection to t1011
    ip address 10.89.60.3 255.255.255.0
    !
    interface Vlan724
    description Connection to t1012
    ip address 10.89.61.3 255.255.255.0
    ip helper-address 10.78.134.6
    ip helper-address 10.13.134.6
    ip helper-address 10.48.142.6
    no ip redirects
    standby ip 10.89.61.1
    standby timers 1 3
    standby preempt delay minimum 3 sync 3
    !
    ..........................................

    Finds:
    "standby ip 10.89.59.1"
    Replaces with:
    "vrrp vrid 722 virtual-ip 10.89.59.1
    then finds:
    standby ip 10.89.61.1
    "vrrp vrid 724 virtual-ip 10.89.61.1

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519
    Can you upload a workbook with a before and after look of your data. It's hard to tell in the text of a post.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    09-10-2012
    Location
    Zanesville, OH
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: search for text, then search for previous text, replace 1st text including number from

    Please find the attached file. This is the complete file.
    My need has changed a little:

    On the "New Config" sheet:
    Replace "????" with an incremental number starting with 100
    increment will increase with every "#" found
    if "interface Vlan-interface" number is greater than or equal to 700
    start at 200 and increment up with each "#"
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    09-10-2012
    Location
    Zanesville, OH
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: search for text, then search for previous text, replace 1st text including number from

    I have thought about this more and would like to start over with a new post because this is too complex.
    Last edited by kldailey; 11-06-2012 at 05:26 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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