problem with combobox

jgalas

Board Regular
Joined
Jul 4, 2011
Messages
111
Office Version
  1. 2013
Platform
  1. Windows
In a userform i have several comboboxs, some are hide...
I want a code who show a combo call "txt_dupla" when value of range "(S22")=1

I use those codes in the userform, dont seems working.. combo dont show.

Code:
Private Sub UserForm_Initialize()
Me.txt_nivel.RowSource = "Dados!x3:x4"
Me.txt_curso.RowSource = "Dados!w3:w4"
Me.txt_tipo.RowSource = "Dados!y3:y4"
Me.txt_dupla.RowSource = "Dados!y10:y20"

txt_dupla.Visible = False
end sub

Code:
Private Sub bt_gravar_Click()
Dim r As Long
     Application.Visible = False
     Sheets("Dados").Activate
     desprotege
     Range("r19").Select
     ActiveCell.Offset(1, 0) = txt_curso.Value
     ActiveCell.Offset(2, 0) = txt_nivel.Value
     ActiveCell.Offset(3, 0) = txt_tipo.Value
     ActiveCell.Offset(4, 0) = txt_design.Value
           
     r = Sheets("Dados").Range("S22").Value
     If r = 1 Then
        txt_dupla.Visible = True
        Label7.Visible = True
        ActiveCell.Offset(5, 0) = txt_dupla.Value
     End If
        
     protege
   
     Unload Me
     Menu.Show
End Sub

the value of Sheets("Dados").Range("S22") change with the input of combo "txt_tipo".

Thanks for the help
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Seems I have figured out how to do it ... thanks

Code:
Private Sub txt_tipo_Change()
Dim r As Long
     
     r = Range("S22").Value
     If r = 1 Then
        txt_dupla.Visible = True
        Label7.Visible = True
        ActiveCell.Offset(5, 0) = txt_dupla.Value
     End If
End Sub
I'm so noob.....
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,762
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top