Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating a directory from a date
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating Spreadsheet with Date Formula | New Users to Excel | |||
Creating Directory Structure from Cell Value | Excel Worksheet Functions | |||
creating directory for workbook | Excel Discussion (Misc queries) | |||
Creating Links to files in a shared directory | Excel Discussion (Misc queries) | |||
Creating a Date Selector in Excel VBA? | Excel Discussion (Misc queries) |