Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' MACRO PARA CRIAR PASTA DE ANO/MES/DIA
- Public Const sCaminho = "\lmserver01comercialANALISES LUCASRelatorios Lucas e RodrigoSoftwaresVendas"
- Dim Pasta As New FileSystemObject
- Public Function fnccriardiretorio(data As Date)
- If Pasta.FolderExists(sCaminho & "" & Format(data, "yyyy")) Then
- fncmes (data)
- Else
- Pasta.CreateFolder (sCaminho & "" & Format(data, "yyyy"))
- fncmes (data)
- End If
- End Function
- Public Function fncmes(data As Date)
- If Pasta.FolderExists(sCaminho & "" & Format(data, "yyyy") & _
- "" & Format(data, "mmmm")) Then
- Call fncdia(data)
- Else
- Pasta.CreateFolder (sCaminho & "" & Format(data, "yyyy") & _
- "" & Format(data, "mmmm"))
- Call fncdia(data)
- End If
- End Function
- Public Function fncdia(data As Date)
- If Pasta.FolderExists(sCaminho & "" & Format(data, "yyyy") & _
- "" & Format(data, "mmmm") & "" & Format(data, "dd")) Then
- Else
- Pasta.CreateFolder (sCaminho & "" & Format(data, "yyyy") & _
- "" & Format(data, "mmmm")) & "" & Format(data, "dd")
- End If
- End Function
- Sub chamafuncao()
- Dim data As Date
- data = InputBox("Entre com a Data _EX DD/MM/AAAA")
- Call fnccriardiretorio(data)
- End Sub
Add Comment
Please, Sign In to add comment