+ Reply to Thread
Results 1 to 4 of 4

Writing scripts

  1. #1
    Steve Grosz
    Guest

    Writing scripts

    Where can I find info on writing scripts for Excel. What I am trying to
    do is this. I have a .CVS file that is always in the same format. In 1
    of the colums there are standard phrases that come from the our
    database. What I'd like to do is take those phrases and use something
    like a 'case' command to compare that statement to a list and then based
    on the list, insert the correct action into the same field as the
    standard phrase.

    It would have to loop through all the rows, and those numbers can vary
    quite a bit......

    Can anyone help me on the best way to handle this?

    Thanks!
    Steve

  2. #2
    Pete_UK
    Guest

    Re: Writing scripts

    Can you give some examples of what your "standard phrases" are, what
    your "list" might look like, and what type of thing you mean by
    "correct action"? If you keep your comments this vague you can't expect
    a lot of help!

    Pete


  3. #3
    Steve G
    Guest

    Re: Writing scripts

    Ok, some of the phrases might be along the lines of "unable to contact IP",
    or "No collection from device"

    The 'correct action' would be the result of comparing the above phrase
    against the list of phrases, like the ones above, and so, if the 'unable to
    contact IP' is encountered, the correct action would be to 'verify IP'.

    The hard part is that 2-3 phrases ("unable to contact IP"), etc, may have
    the same result - "verify IP".

    The list has a location, company info, etc, and this phrase being the last
    item on the row. On the next row down, the information is exactly the same.

    Thanks,
    Steve
    "Pete_UK" <[email protected]> wrote in message
    news:[email protected]...
    > Can you give some examples of what your "standard phrases" are, what
    > your "list" might look like, and what type of thing you mean by
    > "correct action"? If you keep your comments this vague you can't expect
    > a lot of help!
    >
    > Pete
    >




  4. #4
    Pete_UK
    Guest

    Re: Writing scripts

    All you need to do is build up a table of two columns - in the first
    column you should record your standard phrases (they must be *exactly*
    as you would expect them, no trailing spaces etc.) and in the second
    column you would record the relevant actions. Let's suppose there are
    50 of these, and that you set up your table to occupy cells X1 to Y50.

    Assume that your standard phrases in the imported data occupy column F,
    starting at F2 to allow for a heading row. In a spare column, let's say
    M, you could enter this formula in M2:

    =VLOOKUP(F2,$X$1:$Y$50,2,0)

    This should give you the appropriate action to the phrase in F2. If you
    have, say, 600 rows of data, you should copy M2 all the way down to
    M600.

    Hope this helps.

    Pete


+ 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