Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i got this.
can i add a command so that when i click that it checks that in textbox1 i got "mypass" and then run the sub and in that sub add a command to go to the editor ("alt" & "f11") Private Sub CommandButton5_Click() Application.Visible = True Unload UserForm1 End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
Try this: Sub test() ' Get text box ActiveSheet.Shapes("Text Box 1").Select If Selection.Characters.Text = "MyPass" Then ' run sub ' Show VBE window Application.VBE.ActiveCodePane.Show End If ' Deselect text box ActiveCell.Activate End Sub HTH, Matthew Pfluger "pswanie" wrote: i got this. can i add a command so that when i click that it checks that in textbox1 i got "mypass" and then run the sub and in that sub add a command to go to the editor ("alt" & "f11") Private Sub CommandButton5_Click() Application.Visible = True Unload UserForm1 End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i have the said textbox on a userform. the aplication (excell workbook) is
set to visible = valse now if i enter "mypass" in the textbox it enable commandbutton1. commandbutton1_click make the application visible = true and unload userform1. then i can get to my macros etc.. "Matthew Pfluger" wrote: Hello, Try this: Sub test() ' Get text box ActiveSheet.Shapes("Text Box 1").Select If Selection.Characters.Text = "MyPass" Then ' run sub ' Show VBE window Application.VBE.ActiveCodePane.Show End If ' Deselect text box ActiveCell.Activate End Sub HTH, Matthew Pfluger "pswanie" wrote: i got this. can i add a command so that when i click that it checks that in textbox1 i got "mypass" and then run the sub and in that sub add a command to go to the editor ("alt" & "f11") Private Sub CommandButton5_Click() Application.Visible = True Unload UserForm1 End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Okay, then change this:
ActiveSheet.Shapes("Text Box 1").Select If Selection.Characters.Text = "MyPass" Then to If Me.TextBox1.Text = "MyPass" Then Does that work for you? Matthew Pfluger "pswanie" wrote: i have the said textbox on a userform. the aplication (excell workbook) is set to visible = valse now if i enter "mypass" in the textbox it enable commandbutton1. commandbutton1_click make the application visible = true and unload userform1. then i can get to my macros etc.. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
jip...
thanx (i did repost. didnt know if u got it flaged for notify of replies...) do u know how to get the (alt & F11) key stroke by code in that? if pass = my pass then alt & f11 key stroke and rest of code "Matthew Pfluger" wrote: Okay, then change this: ActiveSheet.Shapes("Text Box 1").Select If Selection.Characters.Text = "MyPass" Then to If Me.TextBox1.Text = "MyPass" Then Does that work for you? Matthew Pfluger "pswanie" wrote: i have the said textbox on a userform. the aplication (excell workbook) is set to visible = valse now if i enter "mypass" in the textbox it enable commandbutton1. commandbutton1_click make the application visible = true and unload userform1. then i can get to my macros etc.. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
pswanie,
In my original post, the code: Application.VBE.ActiveCodePane.Show will do the same thing as Alt+F11. You can also use the SendKeys method: Application.SendKeys ("%{F11}") where % stands for ALT. See the help files. Matthew Pfluger "pswanie" wrote: jip... thanx (i did repost. didnt know if u got it flaged for notify of replies...) do u know how to get the (alt & F11) key stroke by code in that? if pass = my pass then alt & f11 key stroke and rest of code "Matthew Pfluger" wrote: Okay, then change this: ActiveSheet.Shapes("Text Box 1").Select If Selection.Characters.Text = "MyPass" Then to If Me.TextBox1.Text = "MyPass" Then Does that work for you? Matthew Pfluger "pswanie" wrote: i have the said textbox on a userform. the aplication (excell workbook) is set to visible = valse now if i enter "mypass" in the textbox it enable commandbutton1. commandbutton1_click make the application visible = true and unload userform1. then i can get to my macros etc.. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
AutoRun Macro with a delay to give user the choice to cancel the macro | Excel Programming | |||
Need syntax for RUNning a Word macro with an argument, called from an Excel macro | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |