Excel VBA / planilha bloqueada com senha
#excel #excelbr #vba #excelvba #excelshorts
👉 QUEM SOMOS:
Nosso canal tem como objetivo ensinar Excel e VBA a internautas com pouco ou nenhum conhecimento sobre o assunto. VBA, ou Visual Basic for Application, é uma linguagem de programação que automatiza qualquer tarefa em suas planilhas. Confira!
🔵 CÓDIGO DESTE VÍDEO:
Sub Cadeado()
Dim Cad As Shape
Dim Dis As Double
Set Cad = ActiveSheet.Shapes("Cadeado")
Dis = Cad.Top
If Dis MAIOR 10 Then 'Fechado
Senha = InputBox("")
If Senha = 123 Then Cad.Top = Rows(1).Top + 7
Exit Sub
End If
If Dis MENOR 10 Then 'Aberto
Cad.Top = Rows(1).Top + 15
[F4].Select
End If
End Sub
'----------------------------------------------------------------------------------------
Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Cad As Shape
Dim Dis As Double
Set Cad = ActiveSheet.Shapes("Cadeado")
Dis = Cad.Top
If Dis MAIOR 10 Then [F4].Select
End Sub
📌 DOWNLOAD ARQUIVOS GRÁTIS:
https://drive.google.com/drive/folder...