VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} Email 
   Caption         =   "Email"
   ClientHeight    =   9204.001
   ClientLeft      =   108
   ClientTop       =   456
   ClientWidth     =   6516
   OleObjectBlob   =   "Email2.frx":0000
   StartUpPosition =   1  'CenterOwner
End
Attribute VB_Name = "Email"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub CommandButton1_Click()
Unload Email
nhoras.Show
End Sub

Private Sub CommandButton2_Click()

ThisWorkbook.Worksheets("Registos").Activate

Range("AL1").Value = TextBox1.Value
Range("AL2").Value = TextBox2.Value
Range("AL3").Value = TextBox3.Value
Range("AL4").Value = TextBox4.Value
Range("AL5").Value = TextBox5.Value
Range("AL6").Value = TextBox6.Value
Range("AL7").Value = TextBox7.Value
Range("AL8").Value = TextBox8.Value
Range("AL9").Value = TextBox9.Value
Range("AL10").Value = TextBox10.Value
Range("AL11").Value = TextBox11.Value
Range("AL12").Value = TextBox12.Value
Range("AL13").Value = TextBox13.Value
Range("AL14").Value = TextBox14.Value

If CheckBox1 = True Then Range("AH1").Value = 1 Else Range("AH1").Value = ""
If CheckBox2 = True Then Range("AI1").Value = 1 Else Range("AI1").Value = ""
If CheckBox3 = True Then Range("AJ1").Value = 1 Else Range("AJ1").Value = ""
If CheckBox4 = True Then Range("AK1").Value = 1 Else Range("AK1").Value = ""
If CheckBox6 = True Then Range("AH2").Value = 1 Else Range("AH2").Value = ""
If CheckBox7 = True Then Range("AI2").Value = 1 Else Range("AI2").Value = ""
If CheckBox8 = True Then Range("AJ2").Value = 1 Else Range("AJ2").Value = ""
If CheckBox5 = True Then Range("AK2").Value = 1 Else Range("AK2").Value = ""
If CheckBox10 = True Then Range("AH3").Value = 1 Else Range("AH3").Value = ""
If CheckBox11 = True Then Range("AI3").Value = 1 Else Range("AI3").Value = ""
If CheckBox12 = True Then Range("AJ3").Value = 1 Else Range("AJ3").Value = ""
If CheckBox13 = True Then Range("AK3").Value = 1 Else Range("AK3").Value = ""
If CheckBox14 = True Then Range("AH4").Value = 1 Else Range("AH4").Value = ""
If CheckBox15 = True Then Range("AI4").Value = 1 Else Range("AI4").Value = ""
If CheckBox16 = True Then Range("AJ4").Value = 1 Else Range("AJ4").Value = ""
If CheckBox9 = True Then Range("AK4").Value = 1 Else Range("AK4").Value = ""
If CheckBox18 = True Then Range("AH5").Value = 1 Else Range("AH5").Value = ""
If CheckBox19 = True Then Range("AI5").Value = 1 Else Range("AI5").Value = ""
If CheckBox20 = True Then Range("AJ5").Value = 1 Else Range("AJ5").Value = ""
If CheckBox21 = True Then Range("AK5").Value = 1 Else Range("AK5").Value = ""
If CheckBox23 = True Then Range("AH6").Value = 1 Else Range("AH6").Value = ""
If CheckBox24 = True Then Range("AI6").Value = 1 Else Range("AI6").Value = ""
If CheckBox25 = True Then Range("AJ6").Value = 1 Else Range("AJ6").Value = ""
If CheckBox22 = True Then Range("AK6").Value = 1 Else Range("AK6").Value = ""
If CheckBox26 = True Then Range("AH7").Value = 1 Else Range("AH7").Value = ""
If CheckBox27 = True Then Range("AI7").Value = 1 Else Range("AI7").Value = ""
If CheckBox28 = True Then Range("AJ7").Value = 1 Else Range("AJ7").Value = ""
If CheckBox29 = True Then Range("AK7").Value = 1 Else Range("AK7").Value = ""
If CheckBox30 = True Then Range("AH8").Value = 1 Else Range("AH8").Value = ""
If CheckBox31 = True Then Range("AI8").Value = 1 Else Range("AI8").Value = ""
If CheckBox32 = True Then Range("AJ8").Value = 1 Else Range("AJ8").Value = ""
If CheckBox17 = True Then Range("AK8").Value = 1 Else Range("AK8").Value = ""
If CheckBox35 = True Then Range("AH9").Value = 1 Else Range("AH9").Value = ""
If CheckBox36 = True Then Range("AI9").Value = 1 Else Range("AI9").Value = ""
If CheckBox37 = True Then Range("AJ9").Value = 1 Else Range("AJ9").Value = ""
If CheckBox38 = True Then Range("AK9").Value = 1 Else Range("AK9").Value = ""
If CheckBox39 = True Then Range("AH10").Value = 1 Else Range("AH10").Value = ""
If CheckBox40 = True Then Range("AI10").Value = 1 Else Range("AI10").Value = ""
If CheckBox41 = True Then Range("AJ10").Value = 1 Else Range("AJ10").Value = ""
If CheckBox34 = True Then Range("AK10").Value = 1 Else Range("AK10").Value = ""
If CheckBox42 = True Then Range("AH11").Value = 1 Else Range("AH11").Value = ""
If CheckBox43 = True Then Range("AI11").Value = 1 Else Range("AI11").Value = ""
If CheckBox44 = True Then Range("AJ11").Value = 1 Else Range("AJ11").Value = ""
If CheckBox45 = True Then Range("AK11").Value = 1 Else Range("AK11").Value = ""
If CheckBox47 = True Then Range("AH12").Value = 1 Else Range("AH12").Value = ""
If CheckBox48 = True Then Range("AI12").Value = 1 Else Range("AI12").Value = ""
If CheckBox49 = True Then Range("AJ12").Value = 1 Else Range("AJ12").Value = ""
If CheckBox46 = True Then Range("AK12").Value = 1 Else Range("AK12").Value = ""
If CheckBox50 = True Then Range("AH13").Value = 1 Else Range("AH13").Value = ""
If CheckBox51 = True Then Range("AI13").Value = 1 Else Range("AI13").Value = ""
If CheckBox52 = True Then Range("AJ13").Value = 1 Else Range("AJ13").Value = ""
If CheckBox53 = True Then Range("AK13").Value = 1 Else Range("AK13").Value = ""
If CheckBox54 = True Then Range("AH14").Value = 1 Else Range("AH14").Value = ""
If CheckBox55 = True Then Range("AI14").Value = 1 Else Range("AI14").Value = ""
If CheckBox56 = True Then Range("AJ14").Value = 1 Else Range("AJ14").Value = ""
If CheckBox33 = True Then Range("AK14").Value = 1 Else Range("AK14").Value = ""
Unload Email
nhoras.Show

End Sub

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    If CloseMode = vbFormControlMenu Then
        Cancel = True
        MsgBox "O botão X foi desativado. Use outro método para fechar.", vbInformation
    End If
End Sub

Private Sub UserForm_Initialize()
ThisWorkbook.Worksheets("Registos").Activate

TextBox1.Value = Range("AL1").Value
TextBox2.Value = Range("AL2").Value
TextBox3.Value = Range("AL3").Value
TextBox4.Value = Range("AL4").Value
TextBox5.Value = Range("AL5").Value
TextBox6.Value = Range("AL6").Value
TextBox7.Value = Range("AL7").Value
TextBox8.Value = Range("AL8").Value
TextBox9.Value = Range("AL9").Value
TextBox10.Value = Range("AL10").Value
TextBox11.Value = Range("AL11").Value
TextBox12.Value = Range("AL12").Value
TextBox13.Value = Range("AL13").Value
TextBox14.Value = Range("AL14").Value
If Range("AH1").Value = 1 Then CheckBox1 = True Else CheckBox1 = False
If Range("AI1").Value = 1 Then CheckBox2 = True Else CheckBox2 = False
If Range("AJ1").Value = 1 Then CheckBox3 = True Else CheckBox3 = False
If Range("AK1").Value = 1 Then CheckBox4 = True Else CheckBox4 = False
If Range("AH2").Value = 1 Then CheckBox6 = True Else CheckBox6 = False
If Range("AI2").Value = 1 Then CheckBox7 = True Else CheckBox7 = False
If Range("AJ2").Value = 1 Then CheckBox8 = True Else CheckBox8 = False
If Range("AK2").Value = 1 Then CheckBox5 = True Else CheckBox5 = False
If Range("AH3").Value = 1 Then CheckBox10 = True Else CheckBox10 = False
If Range("AI3").Value = 1 Then CheckBox11 = True Else CheckBox11 = False
If Range("AJ3").Value = 1 Then CheckBox12 = True Else CheckBox12 = False
If Range("AK3").Value = 1 Then CheckBox13 = True Else CheckBox13 = False
If Range("AH4").Value = 1 Then CheckBox14 = True Else CheckBox14 = False
If Range("AI4").Value = 1 Then CheckBox15 = True Else CheckBox15 = False
If Range("AJ4").Value = 1 Then CheckBox16 = True Else CheckBox16 = False
If Range("AK4").Value = 1 Then CheckBox9 = True Else CheckBox9 = False
If Range("AH5").Value = 1 Then CheckBox18 = True Else CheckBox18 = False
If Range("AI5").Value = 1 Then CheckBox19 = True Else CheckBox19 = False
If Range("AJ5").Value = 1 Then CheckBox20 = True Else CheckBox20 = False
If Range("AK5").Value = 1 Then CheckBox21 = True Else CheckBox21 = False
If Range("AH6").Value = 1 Then CheckBox23 = True Else CheckBox23 = False
If Range("AI6").Value = 1 Then CheckBox24 = True Else CheckBox24 = False
If Range("AJ6").Value = 1 Then CheckBox25 = True Else CheckBox25 = False
If Range("AK6").Value = 1 Then CheckBox22 = True Else CheckBox22 = False
If Range("AH7").Value = 1 Then CheckBox26 = True Else CheckBox26 = False
If Range("AI7").Value = 1 Then CheckBox27 = True Else CheckBox27 = False
If Range("AJ7").Value = 1 Then CheckBox28 = True Else CheckBox28 = False
If Range("AK7").Value = 1 Then CheckBox29 = True Else CheckBox29 = False
If Range("AH8").Value = 1 Then CheckBox30 = True Else CheckBox30 = False
If Range("AI8").Value = 1 Then CheckBox31 = True Else CheckBox31 = False
If Range("AJ8").Value = 1 Then CheckBox32 = True Else CheckBox32 = False
If Range("AK8").Value = 1 Then CheckBox17 = True Else CheckBox17 = False
If Range("AH9").Value = 1 Then CheckBox35 = True Else CheckBox35 = False
If Range("AI9").Value = 1 Then CheckBox36 = True Else CheckBox36 = False
If Range("AJ9").Value = 1 Then CheckBox37 = True Else CheckBox37 = False
If Range("AK9").Value = 1 Then CheckBox38 = True Else CheckBox38 = False
If Range("AH10").Value = 1 Then CheckBox39 = True Else CheckBox39 = False
If Range("AI10").Value = 1 Then CheckBox40 = True Else CheckBox40 = False
If Range("AJ10").Value = 1 Then CheckBox41 = True Else CheckBox41 = False
If Range("AK10").Value = 1 Then CheckBox34 = True Else CheckBox34 = False
If Range("AH11").Value = 1 Then CheckBox42 = True Else CheckBox42 = False
If Range("AI11").Value = 1 Then CheckBox43 = True Else CheckBox43 = False
If Range("AJ11").Value = 1 Then CheckBox44 = True Else CheckBox44 = False
If Range("AK11").Value = 1 Then CheckBox45 = True Else CheckBox45 = False
If Range("AH12").Value = 1 Then CheckBox47 = True Else CheckBox47 = False
If Range("AI12").Value = 1 Then CheckBox48 = True Else CheckBox48 = False
If Range("AJ12").Value = 1 Then CheckBox49 = True Else CheckBox49 = False
If Range("AK12").Value = 1 Then CheckBox46 = True Else CheckBox46 = False
If Range("AH13").Value = 1 Then CheckBox50 = True Else CheckBox50 = False
If Range("AI13").Value = 1 Then CheckBox51 = True Else CheckBox51 = False
If Range("AJ13").Value = 1 Then CheckBox52 = True Else CheckBox52 = False
If Range("AK13").Value = 1 Then CheckBox53 = True Else CheckBox53 = False
If Range("AH14").Value = 1 Then CheckBox54 = True Else CheckBox54 = False
If Range("AI14").Value = 1 Then CheckBox55 = True Else CheckBox55 = False
If Range("AJ14").Value = 1 Then CheckBox56 = True Else CheckBox56 = False
If Range("AK14").Value = 1 Then CheckBox33 = True Else CheckBox33 = False

End Sub
