SlideShare una empresa de Scribd logo
1 de 6
Descargar para leer sin conexión
Hoja6 - 1
Private Sub Worksheet_Activate()
Sheets("INICIO").ScrollArea = ("A1:A10")
Cambiauser.Show Modeless
End Sub
ThisWorkbook - 1
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call oculta
End Sub
Private Sub Workbook_Open()
Sheets("INICIO").ScrollArea = ("A1:A10")
Call oculta
UserForm1.Show
End Sub
Cambiauser - 1
'Option Explicit
Const GWL_STYLE = -16
Const WS_CAPTION = &HC00000
Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd A
s Long, ByVal nIndex As Long) As Long
Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As
Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Private Declare PtrSafe Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWin
dowName As String) As Long
'Posición del formulario
Dim FormX As Double, FormY As Double
Private Sub CommandButton1_Click()
Call oculta
UserForm1.Show
End Sub
Private Sub CommandButton2_Click()
Call CERRAR
End Sub
Private Sub UserForm_Initialize()
Dim lngWindow As Long, lFrmHdl As Long
lFrmHdl = FindWindowA(vbNullString, Me.Caption)
lngWindow = GetWindowLong(lFrmHdl, GWL_STYLE)
lngWindow = lngWindow And (Not WS_CAPTION)
Call SetWindowLong(lFrmHdl, GWL_STYLE, lngWindow)
Call DrawMenuBar(lFrmHdl)
End Sub
Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single,
ByVal Y As Single)
If Button = 1 Then
FormX = X
FormY = Y
End If
End Sub
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single,
ByVal Y As Single)
If Button = 1 Then
Me.Left = Me.Left + (X - FormX)
Me.Top = Me.Top + (Y - FormY)
End If
End Sub
Private Sub CloseButton_Click()
Unload Me
End Sub
UserForm1 - 1
'Option Explicit
Const GWL_STYLE = -16
Const WS_CAPTION = &HC00000
Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd A
s Long, ByVal nIndex As Long) As Long
Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As
Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Private Declare PtrSafe Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWin
dowName As String) As Long
'Posición del formulario
Dim FormX As Double, FormY As Double
Private Sub CommandButton1_Click()
Call acceso
End Sub
Private Sub CommandButton2_Click()
Call CERRAR
End Sub
Private Sub UserForm_Initialize()
Dim lngWindow As Long, lFrmHdl As Long
lFrmHdl = FindWindowA(vbNullString, Me.Caption)
lngWindow = GetWindowLong(lFrmHdl, GWL_STYLE)
lngWindow = lngWindow And (Not WS_CAPTION)
Call SetWindowLong(lFrmHdl, GWL_STYLE, lngWindow)
Call DrawMenuBar(lFrmHdl)
TextBoxU = ""
TextBoxC = ""
End Sub
Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single,
ByVal Y As Single)
If Button = 1 Then
FormX = X
FormY = Y
End If
End Sub
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single,
ByVal Y As Single)
If Button = 1 Then
Me.Left = Me.Left + (X - FormX)
Me.Top = Me.Top + (Y - FormY)
End If
End Sub
Módulo1 - 1
Sub acceso()
Dim TablaUsuarios As Range
Dim usuario, clave As String
On Error GoTo advr
Sheets("INICIO").Activate
Range("XFC1").Select
Set TablaUsuarios = Range("XFC2:XFD5")
usuario = UserForm1.TextBoxU
clave = UserForm1.TextBoxC
clavecorrecta = Application.WorksheetFunction.VLookup(usuario, TablaUsuarios, 2, False)
If clavecorrecta <> clave Then GoTo advr
If clave = "anax" Then
Sheets("GONIOMETRICA").Visible = -1
Sheets("GONIOMETRICA").Activate
Sheets("Gráfico y=ax²+bx+c").Visible = -1
ElseIf clave = "pepe" Then
Sheets("SENO").Visible = -1
Sheets("SENO").Activate
ElseIf clave = "rompe" Then
Sheets("Sistema de 3 ecuaciones").Visible = -1
Sheets("Sistema de 3 ecuaciones").Activate
ElseIf clave = "anac" Then
Sheets("Gráfico y=ax+b").Visible = -1
Sheets("Gráfico y=ax+b").Activate
End If
Unload UserForm1
End
advr:
Ouch = MsgBox("EL USUARIO, LA CLAVE O AMBOS" & Chr(13) _
& "SON ERRONEOS", vbCritical)
End Sub
Sub oculta()
Sheets("GONIOMETRICA").Visible = 2
Sheets("SENO").Visible = 2
Sheets("Sistema de 3 ecuaciones").Visible = 2
Sheets("Gráfico y=ax+b").Visible = 2
Sheets("Gráfico y=ax²+bx+c").Visible = 2
End Sub
Private Sub muestra()
Sheets("GONIOMETRICA").Visible = -1
Sheets("SENO").Visible = -1
Sheets("Sistema de 3 ecuaciones").Visible = -1
Sheets("Gráfico y=ax+b").Visible = -1
Sheets("Gráfico y=ax²+bx+c").Visible = -1
End Sub
Módulo1 - 2
Sub CERRAR()
SIONO = MsgBox("¿SEGURO QUE QUIERE SALIR?", vbYesNo)
If SIONO = vbYes Then
Unload UserForm1
ActiveWorkbook.Close
End If
End Sub
Sub lanza_form()
UserForm1.Show
End Sub

Más contenido relacionado

La actualidad más candente

Reservasi hotel
Reservasi hotelReservasi hotel
Reservasi hotel
dian pw
 
Programming a guide gui
Programming a guide guiProgramming a guide gui
Programming a guide gui
Mahmoud Hikmet
 
Example of JAVA Program
Example of JAVA ProgramExample of JAVA Program
Example of JAVA Program
Trenton Asbury
 

La actualidad más candente (19)

شرح مقرر البرمجة 2 لغة جافا - الوحدة الرابعة
شرح مقرر البرمجة 2   لغة جافا - الوحدة الرابعةشرح مقرر البرمجة 2   لغة جافا - الوحدة الرابعة
شرح مقرر البرمجة 2 لغة جافا - الوحدة الرابعة
 
iOS Talks 1 - CodeCamp Osijek - Swift u praksi
iOS Talks 1 - CodeCamp Osijek - Swift u praksiiOS Talks 1 - CodeCamp Osijek - Swift u praksi
iOS Talks 1 - CodeCamp Osijek - Swift u praksi
 
Burrowing through go! the book
Burrowing through go! the bookBurrowing through go! the book
Burrowing through go! the book
 
Reservasi hotel
Reservasi hotelReservasi hotel
Reservasi hotel
 
かとうの Kotlin 講座 こってり版
かとうの Kotlin 講座 こってり版かとうの Kotlin 講座 こってり版
かとうの Kotlin 講座 こってり版
 
Groovy puzzlers jug-moscow-part 2
Groovy puzzlers jug-moscow-part 2Groovy puzzlers jug-moscow-part 2
Groovy puzzlers jug-moscow-part 2
 
Programming a guide gui
Programming a guide guiProgramming a guide gui
Programming a guide gui
 
Pre zen ta sion
Pre zen ta sionPre zen ta sion
Pre zen ta sion
 
Exceptional exceptions
Exceptional exceptionsExceptional exceptions
Exceptional exceptions
 
The Ring programming language version 1.5.3 book - Part 46 of 184
The Ring programming language version 1.5.3 book - Part 46 of 184The Ring programming language version 1.5.3 book - Part 46 of 184
The Ring programming language version 1.5.3 book - Part 46 of 184
 
The Ring programming language version 1.3 book - Part 36 of 88
The Ring programming language version 1.3 book - Part 36 of 88The Ring programming language version 1.3 book - Part 36 of 88
The Ring programming language version 1.3 book - Part 36 of 88
 
The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210
 
ES6, WTF?
ES6, WTF?ES6, WTF?
ES6, WTF?
 
PyconKR 2018 Deep dive into Coroutine
PyconKR 2018 Deep dive into CoroutinePyconKR 2018 Deep dive into Coroutine
PyconKR 2018 Deep dive into Coroutine
 
Thread base theory test
Thread base theory testThread base theory test
Thread base theory test
 
The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202
 
Example of JAVA Program
Example of JAVA ProgramExample of JAVA Program
Example of JAVA Program
 
ملخص البرمجة المرئية - الوحدة السادسة
ملخص البرمجة المرئية - الوحدة السادسةملخص البرمجة المرئية - الوحدة السادسة
ملخص البرمجة المرئية - الوحدة السادسة
 
Devtools Tips & Tricks
Devtools Tips & TricksDevtools Tips & Tricks
Devtools Tips & Tricks
 

Similar a Control de acceso con excel

Código Editor Net
Código Editor NetCódigo Editor Net
Código Editor Net
cymbron
 
Inventory management
Inventory managementInventory management
Inventory management
Rajeev Sharan
 

Similar a Control de acceso con excel (20)

Kajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third YearKajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third Year
 
Pooja Sharma , BCA Third Year
Pooja Sharma , BCA Third YearPooja Sharma , BCA Third Year
Pooja Sharma , BCA Third Year
 
Idioms in swift 2016 05c
Idioms in swift 2016 05cIdioms in swift 2016 05c
Idioms in swift 2016 05c
 
Corona sdk
Corona sdkCorona sdk
Corona sdk
 
Visual Basic(Vb) practical
Visual Basic(Vb) practicalVisual Basic(Vb) practical
Visual Basic(Vb) practical
 
Ete programs
Ete programsEte programs
Ete programs
 
The Ring programming language version 1.5.3 book - Part 25 of 184
The Ring programming language version 1.5.3 book - Part 25 of 184The Ring programming language version 1.5.3 book - Part 25 of 184
The Ring programming language version 1.5.3 book - Part 25 of 184
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
 
The Ring programming language version 1.9 book - Part 71 of 210
The Ring programming language version 1.9 book - Part 71 of 210The Ring programming language version 1.9 book - Part 71 of 210
The Ring programming language version 1.9 book - Part 71 of 210
 
Macros
MacrosMacros
Macros
 
Visual Basic
Visual BasicVisual Basic
Visual Basic
 
Rakesh Bijawat , BCA Third Year
Rakesh Bijawat , BCA Third YearRakesh Bijawat , BCA Third Year
Rakesh Bijawat , BCA Third Year
 
Kirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third YearKirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third Year
 
Kotlin from-scratch 2 - functions
Kotlin from-scratch 2 - functionsKotlin from-scratch 2 - functions
Kotlin from-scratch 2 - functions
 
.NET F# Events
.NET F# Events.NET F# Events
.NET F# Events
 
Ravi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearRavi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third Year
 
Código Editor Net
Código Editor NetCódigo Editor Net
Código Editor Net
 
Inventory management
Inventory managementInventory management
Inventory management
 
Reshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third YearReshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third Year
 
The Ring programming language version 1.7 book - Part 37 of 196
The Ring programming language version 1.7 book - Part 37 of 196The Ring programming language version 1.7 book - Part 37 of 196
The Ring programming language version 1.7 book - Part 37 of 196
 

Último

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Último (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 

Control de acceso con excel

  • 1. Hoja6 - 1 Private Sub Worksheet_Activate() Sheets("INICIO").ScrollArea = ("A1:A10") Cambiauser.Show Modeless End Sub
  • 2. ThisWorkbook - 1 Private Sub Workbook_BeforeClose(Cancel As Boolean) Call oculta End Sub Private Sub Workbook_Open() Sheets("INICIO").ScrollArea = ("A1:A10") Call oculta UserForm1.Show End Sub
  • 3. Cambiauser - 1 'Option Explicit Const GWL_STYLE = -16 Const WS_CAPTION = &HC00000 Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd A s Long, ByVal nIndex As Long) As Long Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long Private Declare PtrSafe Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWin dowName As String) As Long 'Posición del formulario Dim FormX As Double, FormY As Double Private Sub CommandButton1_Click() Call oculta UserForm1.Show End Sub Private Sub CommandButton2_Click() Call CERRAR End Sub Private Sub UserForm_Initialize() Dim lngWindow As Long, lFrmHdl As Long lFrmHdl = FindWindowA(vbNullString, Me.Caption) lngWindow = GetWindowLong(lFrmHdl, GWL_STYLE) lngWindow = lngWindow And (Not WS_CAPTION) Call SetWindowLong(lFrmHdl, GWL_STYLE, lngWindow) Call DrawMenuBar(lFrmHdl) End Sub Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) If Button = 1 Then FormX = X FormY = Y End If End Sub Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) If Button = 1 Then Me.Left = Me.Left + (X - FormX) Me.Top = Me.Top + (Y - FormY) End If End Sub Private Sub CloseButton_Click() Unload Me End Sub
  • 4. UserForm1 - 1 'Option Explicit Const GWL_STYLE = -16 Const WS_CAPTION = &HC00000 Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd A s Long, ByVal nIndex As Long) As Long Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long Private Declare PtrSafe Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWin dowName As String) As Long 'Posición del formulario Dim FormX As Double, FormY As Double Private Sub CommandButton1_Click() Call acceso End Sub Private Sub CommandButton2_Click() Call CERRAR End Sub Private Sub UserForm_Initialize() Dim lngWindow As Long, lFrmHdl As Long lFrmHdl = FindWindowA(vbNullString, Me.Caption) lngWindow = GetWindowLong(lFrmHdl, GWL_STYLE) lngWindow = lngWindow And (Not WS_CAPTION) Call SetWindowLong(lFrmHdl, GWL_STYLE, lngWindow) Call DrawMenuBar(lFrmHdl) TextBoxU = "" TextBoxC = "" End Sub Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) If Button = 1 Then FormX = X FormY = Y End If End Sub Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) If Button = 1 Then Me.Left = Me.Left + (X - FormX) Me.Top = Me.Top + (Y - FormY) End If End Sub
  • 5. Módulo1 - 1 Sub acceso() Dim TablaUsuarios As Range Dim usuario, clave As String On Error GoTo advr Sheets("INICIO").Activate Range("XFC1").Select Set TablaUsuarios = Range("XFC2:XFD5") usuario = UserForm1.TextBoxU clave = UserForm1.TextBoxC clavecorrecta = Application.WorksheetFunction.VLookup(usuario, TablaUsuarios, 2, False) If clavecorrecta <> clave Then GoTo advr If clave = "anax" Then Sheets("GONIOMETRICA").Visible = -1 Sheets("GONIOMETRICA").Activate Sheets("Gráfico y=ax²+bx+c").Visible = -1 ElseIf clave = "pepe" Then Sheets("SENO").Visible = -1 Sheets("SENO").Activate ElseIf clave = "rompe" Then Sheets("Sistema de 3 ecuaciones").Visible = -1 Sheets("Sistema de 3 ecuaciones").Activate ElseIf clave = "anac" Then Sheets("Gráfico y=ax+b").Visible = -1 Sheets("Gráfico y=ax+b").Activate End If Unload UserForm1 End advr: Ouch = MsgBox("EL USUARIO, LA CLAVE O AMBOS" & Chr(13) _ & "SON ERRONEOS", vbCritical) End Sub Sub oculta() Sheets("GONIOMETRICA").Visible = 2 Sheets("SENO").Visible = 2 Sheets("Sistema de 3 ecuaciones").Visible = 2 Sheets("Gráfico y=ax+b").Visible = 2 Sheets("Gráfico y=ax²+bx+c").Visible = 2 End Sub Private Sub muestra() Sheets("GONIOMETRICA").Visible = -1 Sheets("SENO").Visible = -1 Sheets("Sistema de 3 ecuaciones").Visible = -1 Sheets("Gráfico y=ax+b").Visible = -1 Sheets("Gráfico y=ax²+bx+c").Visible = -1 End Sub
  • 6. Módulo1 - 2 Sub CERRAR() SIONO = MsgBox("¿SEGURO QUE QUIERE SALIR?", vbYesNo) If SIONO = vbYes Then Unload UserForm1 ActiveWorkbook.Close End If End Sub Sub lanza_form() UserForm1.Show End Sub