I have a spreadsheet (Excel 2003), that I use as a "Document Transmittal" to document the file's I've sent to a client. I'm not that good at coding in VB and had some help developing the macro in the attached spreadsheet. My macro has tons of "Remarks" to help me figure out how this is all working. The spreadsheet is stored as either an XLT file on the users PC, or as a XLS file in the directory on our network.
The directory structure is always:T:\Project Contracting\If the spreadsheet is in the directory, it's always in "02 - ...", and the documents that we transmit are always in the sub-directory under "03..."09-058 - Project 1\01 - Contract
02 - External
03 - DocTrans03.1 - DocTrans - 01
03.2 - DocTrans - 02
The spreadsheet has 3 columns:Document Number (Column B)We have a standard "File Naming Convention" so a drawing that details the assembly of a widget might look like:
Revision Number (Column C)
Document Name (Column D)
09-058-DW-0001-R0A - Detail, Widget Assembly.PDF
where:
09-058 = Project Number (09 = Year, 058 = 58th contract for given year)
DW = File type "Drawing"
0001 = Drawing Number
R0A = Document Revision Number (can be numerical or alphabetical)
Detail, Widget Assembly = Document Name
My macro currently parses the file name such that a file name of "09-058-DW-0001-R0A - Detail, Widget Assembly", would get parsed out into the following colums:
Column B = 09-058-DW-0001
Column C = 0A
Column D = Detail, Widget Assembly
Questions 1:
The file revision portion of the file name will vary from "R0A", "R01", or even "R10". If the second character in my revision name, is a "0", I want to strip that out so I think in need an "If" statement that tests to see if the second character is "0" and if so, delete it, but not sure how to go about that. Suggestions would be appreciated.
Question 2:
How would I change my "BrowseForFolder" function so that if the file is opened on the users "C:\" drive, it goes to our network, and if it's not on the network, opens up in one directory higher than where it's stored?
Question 3:
I'm getting a "Run-time error: '76':, Path not found", if I "Cancel" out of the "BrowsForFolder" function. I'm missing some error trapping but not sure how to sort that out.
Regards
Bookmarks