I'm using Office 2010, fwiw.
I have a simple macro that I want to complicate. Right now it just adds 30 to a date and highlights it in yellow. I want to add one of two abilities: 1) search through several folders for a document whose name will change periodically and open it, or 2) search in 1 folder for 1 mail merge document whose name will never change and open it.
Option 1 would be a little easier on me once it's all setup, but option 2 sounds a LOT easier to make happen. Anyway, here is my algorithm for option 1, can someone help me translate it into VBA? I've done quite a bit of googling and can't find what I need. (Note that column and row references are to the spreadsheet named One Log to Rule Them All, and the table is named OLtRTA. I would prefer references to the column header name rather than the column letter since I'm likely to add or delete columns and thus things will change).
- Go to G:\Families First\Cases\Region T#, where T# is OLtRTA[Region], or the column T and # is the row number the cursor is on.
- Search in above mentioned folder for a folder containing strings from both G# I# where G and I are OLtRTA[Family name] and OLtRTA[Child(ren)'s Names] (or column G and I) and # is the row number the cursor is on
- Inside that folder, search for a file containing "extensionX" where X is 10 and loops down to 2 until a result is found, then open the file.
- If no result is found in the above loop, search for and open the file containing the string "STF"
If you'd rather help me tackle option 2, below is my algorithm for it:
- Open G:\Families First\Cases\STF-Extension.docx
- OPTIONAL: point the mail merge to X-1, where X is the row number the cursor is on
Thanks for taking time to look at this. Let me know how terrible of an idea this all is
Bookmarks