Macros
Sub mostrar_hojas()
Dim sh As Worksheet
For Each sh In Worksheets
sh .Visible = True
Next
End Sub
PARA MOSTRAR UNA HOJA Y OCULTAR OTRA HOJA
Sub Macro2()Sheets("Hoja2").Visible = True
Sheets("Hoja2").Select
Sheets("Indice").Visible = False
End Sub
Sub Macro3()
Sheets("Indice").Visible = True
Sheets("Indice").Select
Sheets("Hoja2").Visible = False
End Sub
PARAMOSTRAR UNA HOJA O VARIAS Y OCULTAR LA HOJA
Sub UnhideSheet()
Sheets("Sheet1").Visible = True
End SubSub HideSheet()
Sheets("Sheet1").Visible = False
End Sub
CREAR USUARIO Y CONTRASEÑA
Private SubACEPTAR_Click()
user = USUARIO.Value
Sheets("UserPass").Visible = True
Sheets("UserPass").Select
Range("B2:B6").Select
On Error Resume Next
Set u = Selection.Find(What:=user)'Selection.FindNext(After:=ActiveCell).Activate
If u Is Nothing Then
MsgBox "Usuario Incorrecto", vbInformation, "System"
Application.Quit
Application.DisplayAlerts = False
Exit Sub
End If
pass = CONTRASEÑA.Value
Range("C2:C6").SelectOn Error Resume Next
Set c = Selection.Find(What:=pass)
'Selection.FindNext(After:=ActiveCell).Activate
If c Is Nothing Then
MsgBox "Contraseña Incorrecta", vbInformation, "System"
Application.QuitApplication.DisplayAlerts = False
Else
Sheets("UserPass").Protect = "todoexpertos"
Sheets("UserPass").Visible = xlSheetVeryHidden
Sheets("INICIO").Visible = xlSheetVeryHidden
Userform1.HideApplication.Visible = True
End If
End Sub
Private Sub CANCELAR_Click()
Application.Quit
End Sub
Si no se habilitan las macros solo verá una hoja que he llamado INICIO en la hay un mensaje de que si no se habilitanlas macros no podrá utilizar este libro la hoja esta protegida con contraseña y el proyecto de VBA también (la contraseña como veras es "todoexpertos") así no puede ver el código, la hoja donde...
Regístrate para leer el documento completo.