View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.programming
pswanie pswanie is offline
external usenet poster
 
Posts: 247
Default alt & f11 via macro

wait.... i think it does not set focus to the worksheet when i get to unload
userform1. how would i "select/set focus" to my worksheet after that line.

then application.vbe etc

"Matthew Pfluger" wrote:

Are you missing an "End if"?

"pswanie" wrote:

this is what i got and what im using...

i tried moving that one line up/down but with no luck. somewhere it said
something about a with. but that did not work either

Private Sub CommandButton5_Click()

If Me.TextBox55.Value = "b" Then

Application.Visible = True
Application.VBE.ActiveCodePane.Show
Unload UserForm1

Else


MsgBox " This part is restricted" & vbNewLine & _
"Password required/Invalid Password" & vbNewLine & vbNewLine
& _
" Please retry"
End If

End Sub