Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default only load userform if range empty

what code whould i need to add to tell the userform only to load if Sheet1
cell c42 is empty.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default only load userform if range empty

If IsEmpty(Sheets("Sheet1").Range("C42")) Then UserForm1.Show

I presume you mean Show the UserForm, but if you meant Load then use

If IsEmpty(Sheets("Sheet1").Range("C42")) Then Load UserForm1


--

Regards,
Nigel




"pswanie" wrote in message
...
what code whould i need to add to tell the userform only to load if Sheet1
cell c42 is empty.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default only load userform if range empty

jip i meant show.

btw whats the diff?

"Nigel" wrote:

If IsEmpty(Sheets("Sheet1").Range("C42")) Then UserForm1.Show

I presume you mean Show the UserForm, but if you meant Load then use

If IsEmpty(Sheets("Sheet1").Range("C42")) Then Load UserForm1


--

Regards,
Nigel




"pswanie" wrote in message
...
what code whould i need to add to tell the userform only to load if Sheet1
cell c42 is empty.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default only load userform if range empty

There is a bit more to it than that.

If you use Load and the form is not in memory, it will execute any code in
the Userform_Initialise event, and the form will then be in memory but not
shown..

If you use Show and the form is in memory, it will execute any code in the
Userform_Activate event, and the form will be shown.

If you use Show and the form is not in memory, it will execute any code in
the Userform_Initialise event, and then any code in the Userform_Activate
event, and the form will be shown.

The form can only be in memory if it has previously been loaded, or it was
shown and then hidden (Userform1.Hide), not unloaded.


--
HTH

Bob

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

"Nigel" wrote in message
...
Load puts the UserForm into memory but does not show the form in the
interface, UserForm.show loads and then shows it.



--

Regards,
Nigel




"pswanie" wrote in message
...
jip i meant show.

btw whats the diff?

"Nigel" wrote:

If IsEmpty(Sheets("Sheet1").Range("C42")) Then UserForm1.Show

I presume you mean Show the UserForm, but if you meant Load then use

If IsEmpty(Sheets("Sheet1").Range("C42")) Then Load UserForm1


--

Regards,
Nigel




"pswanie" wrote in message
...
what code whould i need to add to tell the userform only to load if
Sheet1
cell c42 is empty.






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default only load userform if range empty

what code do i add to a commandbutton2 for the next?

they enter name and lastname in the textbox. when hitting commandbutton2 i
need that data from textbox1 in the next open cell sheet1 column c down. and
then command button disable. refresh either userform1 or listbox1

should i use unload userform1 or rather userform1.hide?


thanx nigel



"Nigel" wrote:

Load puts the UserForm into memory but does not show the form in the
interface, UserForm.show loads and then shows it.



--

Regards,
Nigel




"pswanie" wrote in message
...
jip i meant show.

btw whats the diff?

"Nigel" wrote:

If IsEmpty(Sheets("Sheet1").Range("C42")) Then UserForm1.Show

I presume you mean Show the UserForm, but if you meant Load then use

If IsEmpty(Sheets("Sheet1").Range("C42")) Then Load UserForm1


--

Regards,
Nigel




"pswanie" wrote in message
...
what code whould i need to add to tell the userform only to load if
Sheet1
cell c42 is empty.


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
Load a CSV into an empty, formatted XLS? Paul H[_2_] Excel Discussion (Misc queries) 15 June 29th 09 10:11 AM
How to load a listbox in a userform? Martin Excel Discussion (Misc queries) 3 July 25th 07 03:16 PM
Userform does not load Ozgur Pars[_2_] Excel Programming 1 April 13th 07 10:35 PM
LOAD userform JohnTheTemp Excel Programming 2 September 9th 05 12:45 AM
Load a Userform Nick Excel Programming 1 September 10th 03 03:24 PM


All times are GMT +1. The time now is 06:55 AM.

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"