Guest User

Untitled

a guest
May 16th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. ' MACRO PARA CRIAR PASTA DE ANO/MES/DIA
  2.  
  3. Public Const sCaminho = "\lmserver01comercialANALISES LUCASRelatorios Lucas e RodrigoSoftwaresVendas"
  4. Dim Pasta As New FileSystemObject
  5.  
  6. Public Function fnccriardiretorio(data As Date)
  7. If Pasta.FolderExists(sCaminho & "" & Format(data, "yyyy")) Then
  8. fncmes (data)
  9. Else
  10. Pasta.CreateFolder (sCaminho & "" & Format(data, "yyyy"))
  11. fncmes (data)
  12. End If
  13.  
  14.  
  15. End Function
  16.  
  17. Public Function fncmes(data As Date)
  18. If Pasta.FolderExists(sCaminho & "" & Format(data, "yyyy") & _
  19. "" & Format(data, "mmmm")) Then
  20. Call fncdia(data)
  21. Else
  22. Pasta.CreateFolder (sCaminho & "" & Format(data, "yyyy") & _
  23. "" & Format(data, "mmmm"))
  24. Call fncdia(data)
  25. End If
  26. End Function
  27.  
  28. Public Function fncdia(data As Date)
  29. If Pasta.FolderExists(sCaminho & "" & Format(data, "yyyy") & _
  30. "" & Format(data, "mmmm") & "" & Format(data, "dd")) Then
  31.  
  32. Else
  33. Pasta.CreateFolder (sCaminho & "" & Format(data, "yyyy") & _
  34. "" & Format(data, "mmmm")) & "" & Format(data, "dd")
  35. End If
  36.  
  37.  
  38. End Function
  39. Sub chamafuncao()
  40. Dim data As Date
  41. data = InputBox("Entre com a Data _EX DD/MM/AAAA")
  42. Call fnccriardiretorio(data)
  43. End Sub
Add Comment
Please, Sign In to add comment