Notifications
Clear all

Mensagem com data da última alteração na planilha.

4 Posts
1 Usuários
0 Reactions
695 Visualizações
(@fernandofernandes)
Posts: 43750
Illustrious Member
Topic starter
 

Boa tarde a todos!

Algúem pode me ajudar? Preciso de uma macro que retorne uma mensagem com a data da última alteração feita na planilha.

Preciso que a mensagem apareça quando abrir a pasta de trabalho.

Muito obrigado.

Silvio Felinto

 
Postado : 26/12/2013 11:42 am
(@fernandofernandes)
Posts: 43750
Illustrious Member
Topic starter
 

Boa tarde

Veja se a macro deste link pode te ajudar:

http://www.microsoftexcel.com.br/index. ... uivos.html

At.te

 
Postado : 26/12/2013 12:01 pm
(@fernandofernandes)
Posts: 43750
Illustrious Member
Topic starter
 

Boa tarde!!
Não testado!

Sub AleVBA_10028()
    MsgBox FileLastModified("C:My Documentsabook.xls") '<-Mude para seu local
End Sub
Function FileLastModified(strFullFileName As String)
    Dim fs As Object, f As Object, s As String
     
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFile(strFullFileName)
     
    s = UCase(strFullFileName) & vbCrLf
    s = s & "Last Modified: " & f.DateLastModified
    FileLastModified = s
     
    Set fs = Nothing: Set f = Nothing
     
End Function

Att

 
Postado : 26/12/2013 12:02 pm
(@fernandofernandes)
Posts: 43750
Illustrious Member
Topic starter
 

Resolvi parcialmente o problema com as duas macros abaixo.

Obrigado a todos.

Silvio Felinto

Private Sub Worksheet_Activate()

If Range("j18").Value <> "" Then
MsgBox "Data da última alteração: " & Range("j11").Value
End If

End Sub

Private Sub Worksheet_Deactivate()
Range("j11").Value = Now()
End Sub

 
Postado : 06/01/2014 6:08 am