Interação de Userforms[RESOLVIDO]

M.A.

13-11-2013 16:46:32

Boa Tarde.
Um abraço do outro lado do Atlântico, de um cantinho à beira-mar plantado.

Antes de mais, preciso dizer que sou apenas um autodidata que nada percebe de programação e o que consigo fazer, foi aprendido em fóruns, incluindo este que tem muito boas ajudas.

Tenho um problema que não consigo resolver, nem consigo encontrar ajuda.

Tenho o Userform1 que, através de um Botão para pesquisa, abre o Userform2, composto por 17 botões cada um com acesso a um terceiro Userform.
(São pois 17 Userforms). Cada um destes Userforms contêm códigos que serão escritos em textboxs e que clicando no botão inserir, serão transpostos para o Userform1.
Acontece que preciso navegar por outros Userforms (dentro dos 17 mencionados) e inserir outros códigos. Clicando em inserir, vai substituir os anteriormente gravados.
Pretende-se pois que todos os códigos selecionados fiquem no Userform1 para depois serem gravados na respetiva folha Excell

O meu pedido de ajuda direciona-se portanto para a seguinte questão:
Há algum código que permita memorizar os códigos anteriores e permita acrescentar os posteriormente inseridos?
Será possível fazê-lo?

Se eventualmente tiverem uma solução melhor para o meu aplicativo, agradecia sugestões.

Cumprimentos
M.A.

Lúcio Mauro da Silva

13-11-2013 20:43:51

Boa tarde!
Você teria o arquivo para anexar ao forum?

Abraço!

M.A.

14-11-2013 00:26:40

Boa noite.

Antes de mais, um obrigado pela rápida resposta.
Como já é tarde, coloco o código amanhã. Está construído de forma pouco profissional, mas para quem nada sabe de programação VB ou outra linguagem, não está mal e o mais importante é que sozinho, consegui atingir o objetivo e resolver o meu problema.
Embora de forma pouco profissional, funciona que é o mais importante.

Boa noite e obrigado de novo.

Um abraço
M.A.

M.A.

14-11-2013 15:02:14

Boa tarde.

O prometido é devido e como tal segue o código que tenho. Caso seja possível dar um toque mais profissional, agradecia a gentileza.

Código do Form principal:

Código: Selecionar todos

Private Sub UserForm_RegistoConsultas_Activate()
Sheets("DADOS").Select
ActiveSheet.Protect
CommandButton5_sair.SetFocus

End Sub

'Private Sub Workbook_Open()
'Load UserForm_RegistoConsultas
'UserForm_RegistoConsultas.Show
'CommandButton5_sair.SetFocus
'End Sub

Private Sub CommandButton3_gravar_Click()

Sheets("DADOS").Select
Sheets("DADOS").Unprotect

Range("A2").Select
Call FORMATAR_TEXTO
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select

End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell = TextBox1_nop.Value
Call FORMATAR_TEXTO

ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox2_data.Text
Call FORMATAR_TEXTO

ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox_nome.Text
Call FORMATAR_TEXTO

ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox_idade.Value
Call FORMATAR_TEXTO

ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox_sexo.Text
Call FORMATAR_TEXTO

ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox_motivocons.Text
Call FORMATAR_TEXTO

ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox_tipoconsul.Text
Call FORMATAR_TEXTO

ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox_plano.Text
Call FORMATAR_TEXTO

ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox_medicacao.Text
Call FORMATAR_TEXTO

ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox3.Text
Call FORMATAR_TEXTO

End Sub

Private Sub CommandButton5_sair_Click()
Unload UserForm_RegistoConsultas
Set UserForm_RegistoConsultas = Nothing
Sheets("Folha1").Select

End Sub

Private Sub CommandButton6_PROC_Click()
UserForm_RegistoConsultas.Hide
UserForm1_CAPITULOS.CommandButton66.Visible = False
UserForm1_CAPITULOS.Show
End Sub

Private Sub CommandButton7_PROC_Click()
UserForm_RegistoConsultas.Hide
UserForm1_CAPITULOS.CommandButton66.Visible = True
UserForm1_CAPITULOS.CommandButton65_INSER.Visible = False
UserForm1_CAPITULOS.Show
End Sub

Private Sub TextBox_medicacao_Exit(ByVal Cancel As MSForms.ReturnBoolean)

If IsNumeric(TextBox_medicacao.Value) = True Then
MsgBox "DIGITE O TIPO DE CONSULTA CORRETO."
Cancel = True
TextBox_medicacao.Value = vbNullString
End If

End Sub

Private Sub TextBox_plano_Exit(ByVal Cancel As MSForms.ReturnBoolean)

If IsNumeric(TextBox_plano.Value) = True Then
MsgBox "DIGITE O TIPO DE CONSULTA CORRETO."
Cancel = True
TextBox_plano.Value = vbNullString
End If

End Sub

Private Sub TextBox_tipoconsul_Exit(ByVal Cancel As MSForms.ReturnBoolean)

If IsNumeric(TextBox_tipoconsul.Value) = True Then
MsgBox "DIGITE O TIPO DE CONSULTA CORRETO."
Cancel = True
TextBox_tipoconsul.Value = vbNullString
End If

End Sub

Private Sub TextBox_motivocons_Exit(ByVal Cancel As MSForms.ReturnBoolean)

If IsNumeric(TextBox_motivocons.Value) = True Then
MsgBox "DIGITE OS MOTIVOS CORRETOS."
Cancel = True
TextBox_motivocons.Value = vbNullString
End If

End Sub

'DEFINE O TIPO DE VARIAVEL

Private Sub TextBox1_nop_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'LIMITA LETRAS, SIMBOLOS E ESPAÇOS
'If IsEmpty(TextBox1_nop.Value) = True Then GoTo NOP

If IsNumeric(TextBox1_nop.Value) = False Then
MsgBox "DIGITE APENAS NUMEROS"
Cancel = True
TextBox1_nop.Value = vbNullString
End If

'NOP:
'TextBox1_nop.Value = "0"
'Exit Sub

End Sub

Private Sub TextBox_nome_Exit(ByVal Cancel As MSForms.ReturnBoolean)

'LIMITA A ENTRADA COM CAMPO VAZIO
If Len(TextBox_nome) = 0 Then
MsgBox "ESCREVA UM NOME VÁLIDO"

Cancel = True
TextBox_nome.Text = vbNullString
End If

'LIMITA A ENTRADA DE NUMEROS
If IsNumeric(TextBox_nome.Value) = True Then
MsgBox "ESCREVA UM NOME VÁLIDO"

Cancel = True
TextBox_nome.Text = vbNullString

End If


'FAZ VERIFICAR O NOME
If IsNumeric(TextBox_nome.Value) = False Then
'MsgBox "CONFIRME SE O NOME ESTA CORRECTO!"
Dim Msg, Style, Help, Ctxt, Response, MyString
Msg = "O NOME INSERIDO ESTÁ CORRECTO?"
Style = vbYesNo + vbCritical + vbDefaultButton2
Response = MsgBox(Msg, Style, Title)
End If
'SE A RESPOSTA É NÃO
If Response = vbNo Then
MyString = "NÃO"
Cancel = True
TextBox_nome.Text = vbNullString
End If
'SE A RESPOSTA É SIM
If Response = vbYes Then
MyString = "SIM"
End If
End Sub

'VARIAVEL PARA O CAMPO DATA
Private Sub TextBox2_data_Change()

If Len(TextBox2_data) = 2 Or Len(TextBox2_data) = 6 Then
TextBox2_data.Text = TextBox2_data.Text & "/"
SendKeys "{End}", True
End If

End Sub
Private Sub TextBox_idade_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'LIMITA A ENTRADA DE NUMEROS
If IsNumeric(TextBox_idade.Value) = False Then
MsgBox "DIGITE APENAS NÚMEROS..."

Cancel = True
TextBox_nome.Text = vbNullString


End If
End Sub

Private Sub TextBox_sexo_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'LIMITA À LETRA M
If TextBox_sexo.Text = "M" Then
Sheets("DADOS").Unprotect
Range("B6").Select

'LIMITA À LETRA F
ElseIf TextBox_sexo.Text = "F" Then
Sheets("DADOS").Unprotect
Range("B6").Select


'LIMITA A ENTRADA COM CAMPO VAZIO E OUTROS CARACTERES
Else
MsgBox "SELECCIONE ""M-MACHO"" OU ""F-FEMEA"""
Cancel = True
TextBox_sexo.Text = vbNullString
End If

End Sub

Private Sub UserForm_Terminate()
Unload UserForm_RegistoConsultas
Set UserForm_RegistoConsultas = Nothing
Sheets("Folha1").Select
End Sub 
Código do Form Intermédio:

Código: Selecionar todos

Private Sub CommandButton1_A_Click()
UserForm1_CAPITULOS.Hide
UserForm2_A.Show
End Sub

Private Sub CommandButton2_Click()
UserForm1_CAPITULOS.Hide
UserForm2_B.Show
End Sub

Private Sub CommandButton3_Click()
UserForm1_CAPITULOS.Hide
UserForm2_D.Show
End Sub

Private Sub CommandButton4_Click()
UserForm1_CAPITULOS.Hide
UserForm2_F.Show
End Sub

Private Sub CommandButton5_Click()
UserForm1_CAPITULOS.Hide
UserForm2_H.Show
End Sub

Private Sub CommandButton6_Click()
UserForm1_CAPITULOS.Hide
UserForm2_K.Show
End Sub

Private Sub CommandButton65_INSER_Click()

'MsgBox "CONFIRME SE O NOME ESTA CORRECTO!"
Dim Msg, Style, Help, Ctxt, Response, MyString
Msg = "CONFIRMA OS CÓDIGOS INSERIDOS?"
Style = vbYesNo + vbCritical + vbDefaultButton2
Response = MsgBox(Msg, Style, Title)
'End If
'SE A RESPOSTA É NÃO
If Response = vbNo Then
MyString = "NÃO"
Cancel = True

TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
TextBox7 = ""
TextBox8 = ""
TextBox9 = ""
TextBox10 = ""
TextBox1.SetFocus
End If
'SE A RESPOSTA É SIM
If Response = vbYes Then
MyString = "SIM"
Msg = "CLIQUE NO BOTÃO INSERIR PARA INTRODUÇÃO DOS VALORES"
End If

If UserForm_RegistoConsultas.TextBox_motivocons.Text <> "" = False Then GoTo TB1

TB1:
If TextBox1.Text <> "" Then
UserForm_RegistoConsultas.TextBox_motivocons.Text = TextBox1.Text

GoTo TB2
Else
GoTo TBVAZIA
End If

TB2:
If TextBox2.Text <> "" Then
UserForm_RegistoConsultas.TextBox_motivocons.Text = TextBox1.Text & " - " & TextBox2.Text

GoTo TB3
Else
GoTo TBVAZIA
End If

TB3:
If TextBox3.Text <> "" Then
UserForm_RegistoConsultas.TextBox_motivocons.Text = TextBox1.Text & " - " & TextBox2.Text & " - " & TextBox3.Text

GoTo TB4
Else
GoTo TBVAZIA
End If

TB4:
If TextBox4.Text <> "" Then
UserForm_RegistoConsultas.TextBox_motivocons.Text = TextBox1.Text & " - " & TextBox2.Text & " - " & TextBox3.Text _
& " - " & TextBox4.Text
GoTo TB5
Else
GoTo TBVAZIA
End If

TB5:
If TextBox5.Text <> "" Then
UserForm_RegistoConsultas.TextBox_motivocons.Text = TextBox1.Text & " - " & TextBox2.Text _
                    & " - " & TextBox3.Text & " - " & TextBox4.Text & " - " & TextBox5.Text
GoTo TB6
Else
GoTo TBVAZIA

TB6:
If TextBox6.Text <> "" Then
UserForm_RegistoConsultas.TextBox_motivocons.Text = TextBox1.Text & " - " & TextBox2.Text _
                    & " - " & TextBox3.Text & " - " & TextBox4.Text & " - " & TextBox5.Text _
                    & " - " & TextBox6.Text
GoTo TB7
Else
GoTo TBVAZIA
End If

TB7:
If TextBox7.Text <> "" Then
UserForm_RegistoConsultas.TextBox_motivocons.Text = TextBox1.Text & " - " & TextBox2.Text _
                    & " - " & TextBox3.Text & " - " & TextBox4.Text & " - " & TextBox5.Text _
                    & " - " & TextBox6.Text & " - " & TextBox7.Text
GoTo TB8
Else
GoTo TBVAZIA
End If

TB8:
If TextBox8.Text <> "" Then
UserForm_RegistoConsultas.TextBox_motivocons.Text = TextBox1.Text & " - " & TextBox2.Text _
                    & " - " & TextBox3.Text & " - " & TextBox4.Text & " - " & TextBox5.Text _
                    & " - " & TextBox6.Text & " - " & TextBox7.Text & " - " & TextBox8.Text
GoTo TB9
Else
GoTo TBVAZIA
End If

TB9:
If TextBox9.Text <> "" Then
UserForm_RegistoConsultas.TextBox_motivocons.Text = TextBox1.Text & " - " & TextBox2.Text _
                    & " - " & TextBox3.Text & " - " & TextBox4.Text & " - " & TextBox5.Text _
                    & " - " & TextBox6.Text & " - " & TextBox7.Text & " - " & TextBox8.Text _
                    & " - " & TextBox9.Text
GoTo TB10
Else
GoTo TBVAZIA
End If

TB10:
If TextBox10.Text <> "" Then
UserForm_RegistoConsultas.TextBox_motivocons.Text = TextBox1.Text & " - " & TextBox2.Text _
                    & " - " & TextBox3.Text & " - " & TextBox4.Text & " - " & TextBox5.Text _
                    & " - " & TextBox6.Text & " - " & TextBox7.Text & " - " & TextBox8.Text _
                    & " - " & TextBox9.Text & " - " & TextBox10.Text
Else
GoTo TBVAZIA
End If
End If

TBVAZIA:

TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
TextBox7 = ""
TextBox8 = ""
TextBox9 = ""
TextBox10 = ""

'Unload Me
'Set UserForm1_CAPITULOS = Nothing
'UserForm_RegistoConsultas.Show


End Sub

Private Sub CommandButton66_Click()

'MsgBox "CONFIRME SE O NOME ESTA CORRECTO!"
Dim Msg, Style, Help, Ctxt, Response, MyString
Msg = "CONFIRMA OS CÓDIGOS INSERIDOS?"
Style = vbYesNo + vbCritical + vbDefaultButton2
Response = MsgBox(Msg, Style, Title)
'End If
'SE A RESPOSTA É NÃO
If Response = vbNo Then
MyString = "NÃO"
Cancel = True

TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
TextBox7 = ""
TextBox8 = ""
TextBox9 = ""
TextBox10 = ""
TextBox1.SetFocus
End If
'SE A RESPOSTA É SIM
If Response = vbYes Then
MyString = "SIM"
Msg = "CLIQUE NO BOTÃO INSERIR PARA INTRODUÇÃO DOS VALORES"
End If

If UserForm_RegistoConsultas.TextBox3.Text <> "" = False Then GoTo TB11

TB11:
If TextBox1.Text <> "" Then
UserForm_RegistoConsultas.TextBox3.Text = TextBox1.Text

GoTo TB12
Else
GoTo TBVAZIA1
End If

TB12:
If TextBox2.Text <> "" Then
UserForm_RegistoConsultas.TextBox3.Text = TextBox1.Text & " - " & TextBox2.Text

GoTo TB13
Else
GoTo TBVAZIA1
End If

TB13:
If TextBox3.Text <> "" Then
UserForm_RegistoConsultas.TextBox3.Text = TextBox1.Text & " - " & TextBox2.Text & " - " & TextBox3.Text

GoTo TB14
Else
GoTo TBVAZIA1
End If

TB14:
If TextBox4.Text <> "" Then
UserForm_RegistoConsultas.TextBox3.Text = TextBox1.Text & " - " & TextBox2.Text & " - " & TextBox3.Text _
& " - " & TextBox4.Text
GoTo TB15
Else
GoTo TBVAZIA1
End If

TB15:
If TextBox5.Text <> "" Then
UserForm_RegistoConsultas.TextBox3.Text = TextBox1.Text & " - " & TextBox2.Text _
                    & " - " & TextBox3.Text & " - " & TextBox4.Text & " - " & TextBox5.Text
GoTo TB16
Else
GoTo TBVAZIA1

TB16:
If TextBox6.Text <> "" Then
UserForm_RegistoConsultas.TextBox3.Text = TextBox1.Text & " - " & TextBox2.Text _
                    & " - " & TextBox3.Text & " - " & TextBox4.Text & " - " & TextBox5.Text _
                    & " - " & TextBox6.Text
GoTo TB17
Else
GoTo TBVAZIA1
End If

TB17:
If TextBox7.Text <> "" Then
UserForm_RegistoConsultas.TextBox3.Text = TextBox1.Text & " - " & TextBox2.Text _
                    & " - " & TextBox3.Text & " - " & TextBox4.Text & " - " & TextBox5.Text _
                    & " - " & TextBox6.Text & " - " & TextBox7.Text
GoTo TB18
Else
GoTo TBVAZIA1
End If

TB18:
If TextBox8.Text <> "" Then
UserForm_RegistoConsultas.TextBox3.Text = TextBox1.Text & " - " & TextBox2.Text _
                    & " - " & TextBox3.Text & " - " & TextBox4.Text & " - " & TextBox5.Text _
                    & " - " & TextBox6.Text & " - " & TextBox7.Text & " - " & TextBox8.Text
GoTo TB19
Else
GoTo TBVAZIA1
End If

TB19:
If TextBox9.Text <> "" Then
UserForm_RegistoConsultas.TextBox3.Text = TextBox1.Text & " - " & TextBox2.Text _
                    & " - " & TextBox3.Text & " - " & TextBox4.Text & " - " & TextBox5.Text _
                    & " - " & TextBox6.Text & " - " & TextBox7.Text & " - " & TextBox8.Text _
                    & " - " & TextBox9.Text
GoTo TB20
Else
GoTo TBVAZIA1
End If

TB20:
If TextBox10.Text <> "" Then
UserForm_RegistoConsultas.TextBox3.Text = TextBox1.Text & " - " & TextBox2.Text _
                    & " - " & TextBox3.Text & " - " & TextBox4.Text & " - " & TextBox5.Text _
                    & " - " & TextBox6.Text & " - " & TextBox7.Text & " - " & TextBox8.Text _
                    & " - " & TextBox9.Text & " - " & TextBox10.Text
Else
GoTo TBVAZIA1
End If
End If

TBVAZIA1:

TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
TextBox7 = ""
TextBox8 = ""
TextBox9 = ""
TextBox10 = ""

'Unload Me
'Set UserForm1_CAPITULOS = Nothing
'UserForm_RegistoConsultas.Show

End Sub

Private Sub CommandButton7_Click()
UserForm1_CAPITULOS.Hide
UserForm2_L.Show
End Sub

Private Sub CommandButton8_Click()
UserForm1_CAPITULOS.Hide
UserForm2_N.Show
End Sub

Private Sub CommandButton9_Click()
UserForm1_CAPITULOS.Hide
UserForm2_P.Show
End Sub

Private Sub CommandButton10_Click()
UserForm1_CAPITULOS.Hide
UserForm2_R.Show
End Sub

Private Sub CommandButton11_Click()
UserForm1_CAPITULOS.Hide
UserForm2_S.Show
End Sub

Private Sub CommandButton12_Click()
UserForm1_CAPITULOS.Hide
UserForm2_T.Show
End Sub

Private Sub CommandButton13_Click()
UserForm1_CAPITULOS.Hide
UserForm2_U.Show
End Sub

Private Sub CommandButton14_Click()
UserForm1_CAPITULOS.Hide
UserForm2_W.Show
End Sub

Private Sub CommandButton15_Click()
UserForm1_CAPITULOS.Hide
UserForm2_X.Show
End Sub

Private Sub CommandButton16_Click()
UserForm1_CAPITULOS.Hide
UserForm2_Y.Show
End Sub

Private Sub CommandButton17_Click()
UserForm1_CAPITULOS.Hide
UserForm2_Z.Show
End Sub

Private Sub UserForm_Activate()
CommandButton18.Locked = True
CommandButton19.Locked = True
CommandButton20.Locked = True
CommandButton21.Locked = True
CommandButton22.Locked = True
CommandButton23.Locked = True
CommandButton24.Locked = True
CommandButton25.Locked = True
CommandButton26.Locked = True
CommandButton27.Locked = True
CommandButton28.Locked = True
CommandButton29.Locked = True
CommandButton30.Locked = True
CommandButton31.Locked = True
CommandButton32.Locked = True
CommandButton33.Locked = True
CommandButton34.Locked = True

End Sub

Private Sub UserForm_Terminate()

Unload Me
Set UserForm1_CAPITULOS = Nothing
UserForm_RegistoConsultas.Show
End Sub
Código do Form 3 (são 17 iguais), variando apenas uma letra:

Código: Selecionar todos

Private Sub CommandButton65_INSER_Click()
If UserForm1_CAPITULOS.TextBox1.Text = "" Then
UserForm1_CAPITULOS.TextBox1.Text = TextBox1.Text
ElseIf UserForm1_CAPITULOS.TextBox2.Text = "" Then
UserForm1_CAPITULOS.TextBox2.Text = TextBox1.Text
TextBox1.Text = ""
TextBox1.SetFocus
ElseIf UserForm1_CAPITULOS.TextBox3.Text = "" Then
UserForm1_CAPITULOS.TextBox3.Text = TextBox1.Text
TextBox1.Text = ""
TextBox1.SetFocus
ElseIf UserForm1_CAPITULOS.TextBox4.Text = "" Then
UserForm1_CAPITULOS.TextBox4.Text = TextBox1.Text
TextBox1.Text = ""
TextBox1.SetFocus
ElseIf UserForm1_CAPITULOS.TextBox5.Text = "" Then
UserForm1_CAPITULOS.TextBox5.Text = TextBox1.Text
TextBox1.Text = ""
TextBox1.SetFocus
ElseIf UserForm1_CAPITULOS.TextBox6.Text = "" Then
UserForm1_CAPITULOS.TextBox6.Text = TextBox1.Text
TextBox1.Text = ""
TextBox1.SetFocus
ElseIf UserForm1_CAPITULOS.TextBox7.Text = "" Then
UserForm1_CAPITULOS.TextBox7.Text = TextBox1.Text
TextBox1.Text = ""
TextBox1.SetFocus
ElseIf UserForm1_CAPITULOS.TextBox8.Text = "" Then
UserForm1_CAPITULOS.TextBox8.Text = TextBox1.Text
TextBox1.Text = ""
TextBox1.SetFocus
ElseIf UserForm1_CAPITULOS.TextBox9.Text = "" Then
UserForm1_CAPITULOS.TextBox9.Text = TextBox1.Text
TextBox1.Text = ""
TextBox1.SetFocus
ElseIf UserForm1_CAPITULOS.TextBox10.Text = "" Then
UserForm1_CAPITULOS.TextBox10.Text = TextBox1.Text
End If
TextBox1.Text = ""
TextBox1.SetFocus
End Sub

Private Sub MultiPage1_Change()
If MultiPage1.Value = "0" Then MultiPage1.BackColor = &HFFFFFF
If MultiPage1.Value = "0" Then UserForm2_A.BackColor = &HFFFFFF
TextBox1.SetFocus
If MultiPage1.Value = "1" Then MultiPage1.BackColor = &H80FF80
If MultiPage1.Value = "1" Then UserForm2_A.BackColor = &H80FF80
TextBox1.SetFocus
If MultiPage1.Value = "2" Then MultiPage1.BackColor = &H80FFFF
If MultiPage1.Value = "2" Then UserForm2_A.BackColor = &H80FFFF
TextBox1.SetFocus
If MultiPage1.Value = "3" Then MultiPage1.BackColor = &HFFFFC0
If MultiPage1.Value = "3" Then UserForm2_A.BackColor = &HFFFFC0
TextBox1.SetFocus
If MultiPage1.Value = "4" Then MultiPage1.BackColor = &HC0C0FF
If MultiPage1.Value = "4" Then UserForm2_A.BackColor = &HC0C0FF
TextBox1.SetFocus
If MultiPage1.Value = "5" Then MultiPage1.BackColor = &HFF0000
If MultiPage1.Value = "5" Then UserForm2_A.BackColor = &HFF0000
TextBox1.SetFocus
If MultiPage1.Value = "6" Then MultiPage1.BackColor = &HFFC0FF
If MultiPage1.Value = "6" Then UserForm2_A.BackColor = &HFFC0FF
TextBox1.SetFocus
End Sub

Private Sub UserForm_Activate()
MultiPage1.Visible = True
MultiPage1.Value = "0"
TextBox1.SetFocus
End Sub

Private Sub UserForm_Terminate()
Unload Me
Set UserForm2_A = Nothing
UserForm1_CAPITULOS.Show
End Sub
O aspeto dos Userforms segue em anexo, mas o que eu queria mesmo era juntar os Userforms 2 e 3 no mesmo Userform, só que me deparei com o facto de os Multipage não permitirem sobreposição.

Toda a ajuda que contribuir para melhorar o aplicativo é bem vinda.

Abraços
M.A.