Simple folder creation for a VB simpleton
Simple folder creation for a VB simpleton
(OP)
We have a generic folder structure which we use for all new projects we start, each new project gets a project number from an excel sheet and currently the individual has to then create the folder, to the same number and then copy the folders from the generic structure into the newly created folder.
I would like to create a button which does all of the above steps with the press of one VB button at the end of the line. However I am not proficient with VB and am looking for some general pointers.
I would like to create a button which does all of the above steps with the press of one VB button at the end of the line. However I am not proficient with VB and am looking for some general pointers.
RE: Simple folder creation for a VB simpleton
CODE
mygroup = "C:\Test" 'originals
mynewdir = "c:\test" & CStr(Range("A12").Value)
MkDir mynewdir
Dim w As New FileSystemObject
w.CopyFolder mygroup, mynewdir & "\", True
Set w = Nothing
End Sub
This example picks up the value in Cell A12 and concatenates that value onto 'test' giving the new directory a name such as 'test233' (if A12 contains 233). You will need to add error checking to ensure that the directory doesn't already exist.
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting
UK steam enthusiasts: www.essexsteam.co.uk