Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Close user form when button is pressed

Hi! i have a button in a user form. when this button is pressed i want the
user form to close. however, i do not seem to manage this. in the code for
the button antother program is called. but the problem seems to be that the
buttons code is declared private and when i write Close userForm1 the
computer says it is incompatible types. help!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Close user form when button is pressed

Hi April27,

Look at the Unload statement in VBA help.

The following worked for me:

'=============
Private Sub CommandButton1_Click()
Unload Me
End Sub
'<<=============


---
Regards,
Norman


"april27" wrote in message
...
Hi! i have a button in a user form. when this button is pressed i want the
user form to close. however, i do not seem to manage this. in the code for
the button antother program is called. but the problem seems to be that
the
buttons code is declared private and when i write Close userForm1 the
computer says it is incompatible types. help!!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Close User Form Gazz_85[_2_] Excel Discussion (Misc queries) 1 July 8th 09 10:38 AM
User form x button Greg[_27_] Excel Programming 4 May 12th 06 04:56 PM
Open Only the User Form ... or Close Everything ! monir Excel Programming 4 April 2nd 06 09:30 PM
Form Close Button ceemo[_37_] Excel Programming 3 October 12th 05 10:39 PM
Form Close button fran Excel Programming 2 September 16th 03 09:32 PM


All times are GMT +1. The time now is 09:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"