CarlStephens
Board Regular
- Joined
- Sep 25, 2020
- Messages
- 128
- Office Version
- 2016
- Platform
- Windows
Hello All,
I have a excel doc on One Drive that is shared for multiple users, and the below code basically creates a folder in a location referencing a concatenated cell, per the below:
The spreadsheet knows on whose PC to set the folder up based on the windows user ID that is saved in the spreadsheet, which on the above is 08448.
Now, the interesting part.......if the users ID begins with a letter or an number other than zero, all is good and the code works, however, I have a user whose user windows user ID is 08448 and for the life of me I cannot keep the leading zero in the cell. where the user ID is stored. I have tried =TEXT, =CONCATENATE, CUSTOM 00000, and nothing is working.....in short, I need the cell to be in number format and show the 0. Any ideas on this? Thank you.
Sub NewFolder()
'
If Len(Dir([B3] & [M1], vbDirectory)) = 0 Then
MkDir [B3] & [M1]
MsgBox "Folder created in location"
Else
MsgBox "Folder already exists!"
End If
End Sub
I have a excel doc on One Drive that is shared for multiple users, and the below code basically creates a folder in a location referencing a concatenated cell, per the below:
C:\Users\8448\Desktop\Candidates\Hotel_Svc\ |
The spreadsheet knows on whose PC to set the folder up based on the windows user ID that is saved in the spreadsheet, which on the above is 08448.
Now, the interesting part.......if the users ID begins with a letter or an number other than zero, all is good and the code works, however, I have a user whose user windows user ID is 08448 and for the life of me I cannot keep the leading zero in the cell. where the user ID is stored. I have tried =TEXT, =CONCATENATE, CUSTOM 00000, and nothing is working.....in short, I need the cell to be in number format and show the 0. Any ideas on this? Thank you.
Sub NewFolder()
'
If Len(Dir([B3] & [M1], vbDirectory)) = 0 Then
MkDir [B3] & [M1]
MsgBox "Folder created in location"
Else
MsgBox "Folder already exists!"
End If
End Sub