question

Andre-9885 avatar image
0 Votes"
Andre-9885 asked DSPatrick answered

Preciso de um código em VBA que realize uma condição verifique se existem pastas em um diretorio e caso haja exclua todas as pastas já tenteni concater Rndir arquivo cells(1. "A") entrte outros mais não estou tendo sucesso

Private Sub CommandButton1_Click()

raiz = "C:\Users\mxxxx\OneDrivexxxDocuments\01 - xxxxxx\04 - Logs\1 - Enviar por e-mail\New folder\"

For linha = 1 To 60

 pasta = raiz & Cells(1, "A").Value & "\"
    
 tipo = "*.*"
    
 arquivo = Dir(pasta & tipo)
    
 Do Until arquivo = ""
    
        
           
     Kill pasta & arquivo
                       
     arquivo = Dir()
    
   Kill pasta
      
   Else
      
   Kill pasta
   End If
      
 Loop

Next

not-supported
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DSPatrick avatar image
0 Votes"
DSPatrick answered

Q&A forums are currently English only. I'd try asking for help over here in dedicated forums.
https://social.msdn.microsoft.com/Forums/pt-br/home
https://social.technet.microsoft.com/Forums/pt-br/home
https://answers.microsoft.com/pt-br

--please don't forget to upvote and Accept as answer if the reply is helpful--


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.