using wildcards and moving folders

J

JayM

I have written the following code
Sub ClientFolder()
' New Client Folder Creation

Dim MyFolderName

MyFolderName = InputBox("Please type Client's Folder Name :")
MkDir "c:\data2\_Clients\" + MyFolderName
MkDir "c:\data2\_Clients\" + MyFolderName + "\" + "Bills"
MkDir "c:\data2\_Clients\" + MyFolderName + "\" + "Documents"
MkDir "c:\data2\_Clients\" + MyFolderName + "\" + "Correspondence"

End Sub

I want to be able to check the first letter of MyFolderName and then move
that folder into c:\data2\_Clients\A (or B or C etc) dependent on what the
initial letter is thereby having 26 folders (A thru' Z) to alphabetically
list all clients

Any help would be greatly appreciated

Thanks
 
D

Doug Robbins - Word MVP

How about using:

MyFolderName = InputBox("Please type Client's Folder Name :")
MkDir "c:\data2\_Clients\" & Left(MyFolderName, 1) & "\" & MyFolderName
MkDir "c:\data2\_Clients\" & Left(MyFolderName, 1) & "\" &
MyFolderNameMyFolderName & "\Bills"
MkDir "c:\data2\_Clients\" & Left(MyFolderName, 1) & "\" &
MyFolderNameMyFolderName & "\Documents"
MkDir "c:\data2\_Clients\" & Left(MyFolderName, 1) & "\" &
MyFolderNameMyFolderName & "\Correspondence"

Note that you use the ampersand to concatenate the string, not the +


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top