Suíte Office:
Tópico Oficial Dicas de Excel
__________________________________________
Envie MP para sugerir tópicos para esta seção.
__________________________________________
1
Sala destinada para questões, dúvidas e dicas envolvendo pacotes ou suítes de escritório destinados ao Windows: instalação, configuração, desempenho, implementações, suítes Office, Open Office, Libre Office etc.
Private Sub Workbook_BeforeClose(cancel As Boolean)
cancel = True
MsgBox "Favor utilizar o botão ''Salvar e Sair'' da planilha.", vbCritical, "Atenção..."
End Sub
Private Sub CommandButton1_Click()
Application.DisplayAlerts = False
On Error Resume Next
ActiveWorkbook.Save
Application.Quit
Application.DisplayAlerts = True
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Cancel = Not bye
If bye = False Then
MsgBox "Favor utilizar o botão ''Salvar e Sair'' da planilha.", vbCritical, "Atenção..."
Else
If bye = True Then
MsgBox "Fechando a Planilha"
End If
End If
End Sub
Public bye As Boolean
Sub Fechar()
bye = True
ThisWorkbook.Close
End Sub
Sub DesprotegerPlanilhaAtiva()
Dim i, i1, i2, i3, i4, i5, i6, j, k, l, m, n As Integer
On Error Resume Next
For i = 65 To 66
For j = 65 To 66
For k = 65 To 66
For l = 65 To 66
For m = 65 To 66
For i1 = 65 To 66
For i2 = 65 To 66
For i3 = 65 To 66
For i4 = 65 To 66
For i5 = 65 To 66
For i6 = 65 To 66
For n = 32 To 126
ActiveSheet.Unprotect Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & Chr (i1) & Chr(i2) & Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
If ActiveSheet.ProtectContents = False Then
MsgBox "Planilha desprotegida com sucesso!!!"
Exit Sub
End If
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
End Sub
Private Sub Worksheet_Activate()
ActiveSheet.ScrollArea = "$A$2:$A$300"
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column <> 1 Then Exit Sub
Dim LR As Long
LR = Cells(Rows.Count, "A").End(xlUp).Row
Range("$A$2:$A" & LR).Sort Key1:=Range("$A$2")
End Sub