ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   code not working (https://www.excelbanter.com/excel-programming/402857-code-not-working.html)

Moh

code not working
 
why does this code not work? ? ? or what have i missed out??

Private Sub CommandButton3_Click()
If Me.TextBox1.Value = 74987 Then
Worksheets("Bank View1").Activate
Unload Me
Else
MsgBox "Wrong Password Please check Password and Try again"
Me.TextBox1 = ""
Sheets("Instructions").Select
End Sub
--

just a early thank you whoever can help ???

Incidental

code not working
 
Hi Moh

Your code seems to be missing the "end if" just before the end sub to
close the if statement.

Hope this helps

Steve


Bob Phillips

code not working
 
Does not work? What does it do, trash your PC, disappear up its own ...

There is a misusing End if at the end, but the compiler would tell you that,
so some detail would help.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Moh" wrote in message
...
why does this code not work? ? ? or what have i missed out??

Private Sub CommandButton3_Click()
If Me.TextBox1.Value = 74987 Then
Worksheets("Bank View1").Activate
Unload Me
Else
MsgBox "Wrong Password Please check Password and Try again"
Me.TextBox1 = ""
Sheets("Instructions").Select
End Sub
--

just a early thank you whoever can help ???




Moh

code not working
 
you are one funny comedian errrrm not

anyway thank you for the help

much appreciated.

Cheers Ears
--



"Bob Phillips" wrote:

Does not work? What does it do, trash your PC, disappear up its own ...

There is a misusing End if at the end, but the compiler would tell you that,
so some detail would help.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Moh" wrote in message
...
why does this code not work? ? ? or what have i missed out??

Private Sub CommandButton3_Click()
If Me.TextBox1.Value = 74987 Then
Worksheets("Bank View1").Activate
Unload Me
Else
MsgBox "Wrong Password Please check Password and Try again"
Me.TextBox1 = ""
Sheets("Instructions").Select
End Sub
--

just a early thank you whoever can help ???





Rick Rothstein \(MVP - VB\)

code not working
 
Bob's point, and something for you to remember for future newsgroup
postings, saying "it does not work" tells us absolutely nothing about your
problem. You have to tell us what you thought was going to happen and what
actually happened instead; then we would have an idea of where to look in
order to help you. Think of it this way... you take your car in to your
service shop and tell the mechanic, "My car doesn't work right"... do you
think he will start right in fixing it, or might he want to know a little
more information first. We need additional information over and above "it
doesn't work" in the same way your mechanic would.

By the way, you didn't mention whether the missing "End If" was your problem
or not.

Rick


"Moh" wrote in message
...
you are one funny comedian errrrm not

anyway thank you for the help

much appreciated.

Cheers Ears
--



"Bob Phillips" wrote:

Does not work? What does it do, trash your PC, disappear up its own ...

There is a misusing End if at the end, but the compiler would tell you
that,
so some detail would help.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"Moh" wrote in message
...
why does this code not work? ? ? or what have i missed out??

Private Sub CommandButton3_Click()
If Me.TextBox1.Value = 74987 Then
Worksheets("Bank View1").Activate
Unload Me
Else
MsgBox "Wrong Password Please check Password and Try again"
Me.TextBox1 = ""
Sheets("Instructions").Select
End Sub
--

just a early thank you whoever can help ???






Moh

code not working
 
thank you steve

this worked for me




"Incidental" wrote:

Hi Moh

Your code seems to be missing the "end if" just before the end sub to
close the if statement.

Hope this helps

Steve




All times are GMT +1. The time now is 10:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com