PAULOF21 Posted November 17, 2015 at 05:11 PM Report Share #589826 Posted November 17, 2015 at 05:11 PM Boas a todos, estou a construir um formulário para uma folha de excel. Ou melhor serão três formulários que remetem uns para os outros à medida que vão sendo preenchidos. O primeiro são dados gerais da entidade, o segundo tem dois botões de rádio (Sim e Não), que caso se escolha "Sim" faz aparecer uma Caixa de texto para preenchimento, caso se escolha "Não" envia para o formulário seguinte. Até aqui tudo bem, porém preciso que a escolha apareça na folha com "Sim" ou "Não". Mas agora está a dar-me um erro e assinala isto: Já coloquei noutro forum, mas não obtive ajuda. Já pesquisei e não consigo chegar a uma solução, será que me poderão ajudar? Obrigado Link to comment Share on other sites More sharing options...
acao Posted November 17, 2015 at 06:38 PM Report Share #589830 Posted November 17, 2015 at 06:38 PM (edited) boas ve se é isto que necessitas: cxdialogInput = MsgBox("O valor da posição da página não é numérico," & vbCrLf&_ "deseja alterar o valor ?", vbYesNo + vbQuestion, "Deseja alterar o valor ?") If (cxdialogInput = vbYes) Then vInputValorPagTrue = False Else vInputValorPagTrue = True End If cumps acao Edited November 17, 2015 at 06:46 PM by acao Link to comment Share on other sites More sharing options...
Solution PAULOF21 Posted December 9, 2015 at 05:14 PM Author Solution Report Share #590508 Posted December 9, 2015 at 05:14 PM Olá CRLF consegui o que queria com este código Private Sub CommandButton1_Click() Range("B22").Value = TextBox_apoios.Text Range("b22").Select With Selection .VerticalAlignment = xlTop .WrapText = True .MergeCells = True End With Unload UserForm2 UserForm3.Show End Sub Private Sub UserForm_Initialize() Dim objCtrl As Control OptionButton1.Value = False OptionButton2.Value = False For Each objCtrl In Me.Controls If Left(objCtrl.Name, 4) = "Text" Then objCtrl.Visible = False Next End Sub Private Sub OptionButton1_Click() 'Dim objCtrl As Control 'For Each objCtrl In Me.Controls 'If OptionButton1.Value Then objCtrl.Visible = True 'Next If OptionButton1.Value = True Then 'Range("G20").Value = IIf(CheckBox1, "Sim", "Não") TextBox_apoios.Visible = True Range("G20").Value = "Sim" Range("B22").Value = TextBox_apoios.Text End If End Sub Private Sub OptionButton2_Click() 'For Each objCtrl In Me.Controls 'If OptionButton2.Value Then objCtrl.Visible = True 'Next 'OptionButton1.Visible = True 'OptionButton2.Visible = True 'Unload UserForm2 If OptionButton2.Value = True Then 'Range("G20").Value = IIf(CheckBox1, "Sim", "Não") 'Range("G20").Value = IIf(CheckBox2, "Sim", "Não") TextBox_apoios.Visible = False TextBox_apoios.Text = "" Range("G20").Value = "Não" End If 'Range("B22").Value = TextBox_apoios.Text 'UserForm3.Show End Sub De qualquer das maneiras obrigado pela ajuda Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now