trichmondcpa
New Member
- Joined
- Jan 28, 2022
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
I wrote a little script to create folders based on a cell value. I ran into an issue because I need to create the folders using people's names and there are numerous that have a middle initial and period (that's the way they are formatted in our systems.)
The code below runs fine but what is happening is when it has to save the folder to Smith, Henry A. & Mary B. (the value in the cell) it will drop the final period and name the folder Smith, Henry A. & Mary B (no final period). I would prefer to not have to go in and monkey around with stripping the periods, etc. if there is a convenient way to just have it use the full name already in the cell. I can I guess strip all the periods just curious to learn if there was a better way.
(I erroneously posted about this being a file name issue and have reported my post hoping to have it removed. I apologize for this mistake.)
The code below runs fine but what is happening is when it has to save the folder to Smith, Henry A. & Mary B. (the value in the cell) it will drop the final period and name the folder Smith, Henry A. & Mary B (no final period). I would prefer to not have to go in and monkey around with stripping the periods, etc. if there is a convenient way to just have it use the full name already in the cell. I can I guess strip all the periods just curious to learn if there was a better way.
(I erroneously posted about this being a file name issue and have reported my post hoping to have it removed. I apologize for this mistake.)
VBA Code:
strDir = Sheets("Table1").Cells(x + 1, 1).Value
strPath = "G:\Folder Test\"
MkDir strPath & strDir