+ Reply to Thread
Results 1 to 3 of 3

worksheet function vs macro

  1. #1
    Thai.NLNguyen@gmail.com
    Guest

    worksheet function vs macro

    Hello,

    I am new to Excel VBA. At my work we need to validate many .txt files
    before we upload these .txt files for further processing. Within each
    ..txt files one 1 line of text contains comma separated values about 1
    client. Some columns in this line of comma separated values need to be
    validated. In short I would like to have column validation for each row
    of data in the .txt file.

    I would like to know how to attack this issue the best way. Do I write
    a macro with all the necessary code to validate these .txt file entries
    (after importing into Excel). So that each time I need to validate a
    ..txt file I open up the template containing the macro and do a "Run"
    macro command. Or do I make use of worksheet functions and build in the
    conditional statements that checks for each line (after importing into
    Excel)?

    Later, I would also like to know if you can generate some sort of error
    messaging feature. Like some columns are required data cells and cannot
    be omitted. Somehow I would like to have compiled all those error
    messages into a new sheet, and once you click on of the error messages
    in the new sheet, it it will take you the original sheet to the excact
    entry that needs to be corrected. This little project starting to smell
    more like a macro.

    This sounds to be a big mouthful and some advice for you gurus out
    there is very much appreciated.

    Thai


  2. #2
    Harlan Grove
    Guest

    Re: worksheet function vs macro

    Thai.NLNguyen@gmail.com wrote...
    ....
    >I would like to know how to attack this issue the best way. . . .

    ....

    Don't use Excel.

    What you describe is simple text file processing. There are much better
    tools for this than Excel, using either functions or macros within
    Excel. If you're running Windows 98SE, Me, 2000 or XP or Internet
    Explorer 5.0 or later, then you have Windows Script Host installed on
    your PC. The validation task you describe would require no more than
    20-30 lines of VBScript code. If you're running Windows NT4, 2000 or
    XP, then you could even do this using batch files. That includes
    prompting the user to enter/correct invalid fields and writing the
    corrections to replacement text files.


  3. #3
    Thai.NLNguyen@gmail.com
    Guest

    Re: worksheet function vs macro

    Harlan,

    Thank you for the tips and insight. I will look at the options and give
    it a go.

    Thai

    Harlan Grove wrote:
    > Thai.NLNguyen@gmail.com wrote...
    > ...
    > >I would like to know how to attack this issue the best way. . . .

    > ...
    >
    > Don't use Excel.
    >
    > What you describe is simple text file processing. There are much better
    > tools for this than Excel, using either functions or macros within
    > Excel. If you're running Windows 98SE, Me, 2000 or XP or Internet
    > Explorer 5.0 or later, then you have Windows Script Host installed on
    > your PC. The validation task you describe would require no more than
    > 20-30 lines of VBScript code. If you're running Windows NT4, 2000 or
    > XP, then you could even do this using batch files. That includes
    > prompting the user to enter/correct invalid fields and writing the
    > corrections to replacement text files.



+ 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