View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 1
Default Creating a directory from a date

Thank you. This worked like a charm. I didn't know about the Year, (and I'm
assuming Day, and Month) functions. I really need to broaden my VBA
vocabulary :).

"mark" wrote in message
...
Here's one way:

Sub test()

Dim stYear As String
Dim stExists As String


stYear = Year(Range("b10").Value)
stExists = Dir("f:\" & stYear, vbDirectory)

If stExists = "" Then

MkDir "f:\" & stYear

End If

End Sub