I'm trying to create an excel workbook that when opened, looks at a text file to check the environ("username") exists in the text file. My vba skills are quite good, but have never had to do anything referring to another file.
I'm trying to create an excel workbook that when opened, looks at a text file to check the environ("username") exists in the text file. My vba skills are quite good, but have never had to do anything referring to another file.
Why not simply store the list on a very hidden worksheet in the workbook itself...?
Would make things a whole lot simpler.
cytop, thanks for the reply - yes I did think about it. However, I will eventually have a vast number of workbooks that will require the username check and I will need to add users to the list over time.
Then again, you may want to maintain the file outside of Excel... *
To prevent a name like 'Vic' matching 'Victor', each name should be on it's own line with a space before and after. Thestatement is also required. This goes at the top of the module the function is added to and makes text comparisons case insensitive.Please Login or Register to view this content.
It's a simple call to check:Please Login or Register to view this content.
______________________________________________________________Please Login or Register to view this content.
* Always helps to think things through (me, that is)
Cytop, many thanks for your invaluable help. With a slight tweek, this code has worked perfectly. Thank you.
Slight tweak was to name the Name file with the same root name of the workbook so that each workbook has its own list of names?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks