View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Dolphin Dolphin is offline
external usenet poster
 
Posts: 9
Default Macro to create a new folder according to the month

Hi,

I wanted to have my macro to save my file into a new folder according to the
month it was for (ie, a new folder will be created every month). My macro
goes like this, but it can't seem to work:

Dim myMonth As String
Dim myNewFolder As String

myMonth = Format(Range("c4"), "yymm")
myNewFolder = Format(Range("c4"), "MMM")
myFileName = "M:\RECONCILIATIONS\" & myNewFolder & myMonth & "
SG51-1421000"
ActiveWorkbook.SaveAs Filename:=myFileName, FileFormat:=xlWorkbookNormal

Thanks,
Dolphin