Saberexcel - o site das macros Essas macros e procedimentos do Aplicativo Microsoft Excel VBA, abre um determinado objeto Userform(Formulário) em diversos posições na folha de planilhas, com auxílio de objetos Options, voce poderá escolher o lugar para o posicionamento do Userform.
EM UM MÓDULO COMUM INSIRA OS CÓDIGOS Sub Abrir_userform() If Sheets(1).ComboBox1.Text = "" Then MsgBox "Selecione uma das opções" Else
Select Case Sheets(1).ComboBox1.Text Case "Centro" UserForm1.StartUpPosition = 2 Case "Qualquer Lugar" UserForm1.StartUpPosition = 1 End Select
UserForm1.Show End If End Sub
NA FOLHA [MÓDULO] DE CÓDIGO DO OBJETO USERFORM INSIRA OS PROCEDIMENTOS
Dim X As Integer, Y As Integer
Private Sub optCentro_Click() If optCentro.Value Then UserForm1.Left = X UserForm1.Top = Y End If End Sub
Private Sub optDirAba_Click() If optDirAba.Value Then UserForm1.Left = ActiveWindow.Width - UserForm1.Width UserForm1.Top = ActiveWindow.Height - UserForm1.Height End If End Sub
Private Sub optDirAci_Click()
If optDirAci.Value Then UserForm1.Left = ActiveWindow.Width - UserForm1.Width UserForm1.Top = 0 End If
End Sub
Private Sub optEsqAba_Click() If optEsqAba.Value Then UserForm1.Left = 0 UserForm1.Top = ActiveWindow.Height - UserForm1.Height End If End Sub
Private Sub optEsqAci_Click() If optEsqAci.Value Then UserForm1.Left = 0 UserForm1.Top = 0 End If End Sub
Private Sub UserForm_Activate() X = UserForm1.Left Y = UserForm1.Top End Sub
Aprenda tudo sobre o Aplicativo Microsoft Excel VBA - SaberExcel
|