+ Reply to Thread
Results 1 to 4 of 4

search for text or ??? in column A, set variable or replace

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

    search for text or ??? in column A, set variable or replace

    I would like a macro to do the following:

    Look at each cell in column A of sheet "New Config" starting at A1
    If cell contains "interface Vlan", set variable to incremental number starting at 100
    If Cell contains "????", replace the "????" with (the variable incremental number)
    When "interface Vlan" is found again, set variable to (previous number plus 1)
    Can anyone help?

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: search for text or ??? in column A, set variable or replace

    kldailey,

    As a start...
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

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

    Re: search for text or ??? in column A, set variable or replace

    ~tigeravatar, Thank you for the quick response. It looks to be close to what I need.
    I think the issue is, the cells contain more than the text we are searching for example:
    "interface vlan -interface100"
    "vrrp vrid ???? virtual-ip 10.27.18.1"
    "interface vlan -interface101"
    "vrrp vrid ???? virtual-ip 10.27.20.1"
    "interface vlan -interface211"
    "vrrp vrid ???? virtual-ip 10.27.21.128"


    We only want to replace the "????" portion of the cell.
    Can we change it to "contains" or something like that?
    Last edited by kldailey; 11-06-2012 at 08:31 PM.

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

    Re: search for text or ??? in column A, set variable or replace

    tigeravater,
    I was able to change this to get what I needed.
    Here is what I used
    Please Login or Register  to view this content.
    Thank you

+ 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