Activating a Form in Excel

Amy DeLuca

New Member
Joined
Oct 18, 2002
Messages
39
If the user types "Yes" in cell A1, I want a form to appear (frmFMB). If "No" then just the text to appear in the cell. Is this possible?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Right click your worksheet tab and choose View Code. This should do what you need:-

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A" And UCase(Target) = "YES" Then frmFMB.Show
End Sub

EDIT - it should say $ then A and then $ and then 1, but for some reason this board doesn't like that

_________________<font face="Impact">Hope this helps,
Dan</font>
This message was edited by dk on 2002-10-22 12:18
 
Upvote 0
I don't want the user to have to use uppercase. I have a validation box attached to the cell where the user can only coose "Yes" or "No". How can I rewrite it so that the user can just select the "Yes"?

Thanks for your help!!!
 
Upvote 0
Using DK's code, amend to

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" And Target = "YES" Then frmFMB.Show
End Sub

The macro goes in a sheet module.

Save the file, close it and then re-open it - the macro should "take" (using Excel 97-SR2). The macro works with a validation "Yes/No" drop-down box in cell A1.

Regards,

Mike
 
Upvote 0
Ekim...this worked!!! Thank you!
I put a button in the form that says "OK", what is the code that I attach to it to make it close?

Thanks!!!
 
Upvote 0
Amy,
Put this in the form module (while in the VB editor, double click on the form)

Private Sub CommandButton1_Click()
Unload Me ' or Unload frmFMB
End Sub

The code assumes that your Command Button is named CommandButton1 (if not, change to appropriate description).

Regards,


Mike
 
Upvote 0

Forum statistics

Threads
1,213,504
Messages
6,114,020
Members
448,543
Latest member
MartinLarkin

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