![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: England
Posts: 212
|
I'm trying to fit a prompt into a macro, I have created a Form which asks for a monthly cost. I have linked the monthly cost to a particular cell. The cell is updated with the value that I enter but only when i manually close the form down, I cannot get the form to close down automaticallly. How can I put an "OK" to confirm on the form and then close the form or a cancel to close the form. Hope someone can help.
Thanks Matt [ This Message was edited by: Matt on 2002-02-18 07:33 ] |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
When do you want the form to close ? when you edit the textbox ? when you hit a button ?
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: England
Posts: 212
|
Preferably when I hit an OK button
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Put a commandbutton there and this code will close the form when hit.
Private Sub CommandButton1_Click() Unload Me End Sub |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Feb 2002
Location: England
Posts: 212
|
Thanks Thats great!
|
|
|
|
|
|
#6 |
|
New Member
Join Date: Feb 2002
Location: Kansas City, MO
Posts: 1
|
Matt- How did you link your form to cells in your spreadsheet?
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|