Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Unload a UserForm

How can I Unload UserForm1 if the current range is B5?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Unload a UserForm

What does current range is B5 mean, and what does that have to do with a
userform?

--
HTH

Bob

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

"Patrick C. Simonds" wrote in message
...
How can I Unload UserForm1 if the current range is B5?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Unload a UserForm

Okay

The short version is I need something like:

If cell B5 is active Unload Me

The long an I am afraid convoluted explanation is below:

I have a Userform for each month of the year (which in my original posting I
referred to as UserForm1) all twelve of these UserForms has a button which
loads UserForm2 (while leaving it's self loaded) which has a Yes and a No
button on it.

If they click on Yes, a routine runs to delete some data and then selects
cell B5 of the active worksheet. If they select No UserForm2 closes and you
can make another selection on the month UserForm. UserForm2 is nothing more
than a last chance to back out before deleting the data.

Since all twelve of the monthly UserForms are using UserForm2 I need some
way to close the Monthly UserForm after the delete routine had run. So I
thought I could add an If statement to the UserForm which loaded UserForm2
that would close the Monthly UserForm. Something that like :



"Bob Phillips" wrote in message
...
What does current range is B5 mean, and what does that have to do with a
userform?

--
HTH

Bob

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

"Patrick C. Simonds" wrote in message
...
How can I Unload UserForm1 if the current range is B5?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Unload a UserForm

Okay

The short version is I need something like:

If cell B5 is active Unload Me

The long an I am afraid convoluted explanation is below:

I have a Userform for each month of the year (which in my original posting I
referred to as UserForm1) all twelve of these UserForms has a button which
loads UserForm2 (while leaving it's self loaded) which has a Yes and a No
button on it.

If they click on Yes, a routine runs to delete some data and then selects
cell B5 of the active worksheet. If they select No UserForm2 closes and you
can make another selection on the month UserForm. UserForm2 is nothing more
than a last chance to back out before deleting the data.

Since all twelve of the monthly UserForms are using UserForm2 I need some
way to close the Monthly UserForm after the delete routine had run. So I
thought I could add an If statement to the Month UserForm which loaded
UserForm2
that would close the Monthly UserForm.



"Bob Phillips" wrote in message
...
What does current range is B5 mean, and what does that have to do with a
userform?

--
HTH

Bob

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

"Patrick C. Simonds" wrote in message
...
How can I Unload UserForm1 if the current range is B5?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Unload a UserForm

Figured it out:

If ActiveCell = Range("B5") Then
Unload Me
End If



"Patrick C. Simonds" wrote in message
...
Okay

The short version is I need something like:

If cell B5 is active Unload Me

The long an I am afraid convoluted explanation is below:

I have a Userform for each month of the year (which in my original posting
I
referred to as UserForm1) all twelve of these UserForms has a button which
loads UserForm2 (while leaving it's self loaded) which has a Yes and a No
button on it.

If they click on Yes, a routine runs to delete some data and then selects
cell B5 of the active worksheet. If they select No UserForm2 closes and
you
can make another selection on the month UserForm. UserForm2 is nothing
more
than a last chance to back out before deleting the data.

Since all twelve of the monthly UserForms are using UserForm2 I need some
way to close the Monthly UserForm after the delete routine had run. So I
thought I could add an If statement to the Month UserForm which loaded
UserForm2
that would close the Monthly UserForm.



"Bob Phillips" wrote in message
...
What does current range is B5 mean, and what does that have to do with a
userform?

--
HTH

Bob

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

"Patrick C. Simonds" wrote in message
...
How can I Unload UserForm1 if the current range is B5?







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Unload a UserForm

This uses the default property of both ranges.

It's equivalent to:

if activecell.value = range("b5").value then

So if those cells contain the same thing (or are both empty), you may not want
this....

I'd use
if activecell.address = range("b5").address then
or
if activecell.address = "$B$5" then



"Patrick C. Simonds" wrote:

Figured it out:

If ActiveCell = Range("B5") Then
Unload Me
End If

"Patrick C. Simonds" wrote in message
...
Okay

The short version is I need something like:

If cell B5 is active Unload Me

The long an I am afraid convoluted explanation is below:

I have a Userform for each month of the year (which in my original posting
I
referred to as UserForm1) all twelve of these UserForms has a button which
loads UserForm2 (while leaving it's self loaded) which has a Yes and a No
button on it.

If they click on Yes, a routine runs to delete some data and then selects
cell B5 of the active worksheet. If they select No UserForm2 closes and
you
can make another selection on the month UserForm. UserForm2 is nothing
more
than a last chance to back out before deleting the data.

Since all twelve of the monthly UserForms are using UserForm2 I need some
way to close the Monthly UserForm after the delete routine had run. So I
thought I could add an If statement to the Month UserForm which loaded
UserForm2
that would close the Monthly UserForm.



"Bob Phillips" wrote in message
...
What does current range is B5 mean, and what does that have to do with a
userform?

--
HTH

Bob

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

"Patrick C. Simonds" wrote in message
...
How can I Unload UserForm1 if the current range is B5?




--

Dave Peterson
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
unload userform shiro[_2_] Excel Programming 1 June 29th 08 06:05 AM
Unload a Userform created in VB6 avi Excel Programming 4 April 20th 07 01:49 PM
Show/Unload Userform StephanieH Excel Programming 2 August 24th 06 08:08 PM
Unload Userform doesn't work here - why? rammieib Excel Programming 1 February 23rd 06 01:51 PM
load/unload userform Fred[_22_] Excel Programming 3 August 22nd 05 04:00 AM


All times are GMT +1. The time now is 01:17 PM.

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

About Us

"It's about Microsoft Excel"