Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Performing some activity when loading the worksheet

  Asked By: Clifton    Date: Oct 03    Category: MS Office    Views: 529
  

I need to perform some activity in excel when I open
the workbook. Could you anyone help me what would be
function/event name should I use? If you provide me
some example that would be very helpful for me.

Share: 

 

5 Answers Found

 
Answer #1    Answered By: Anuja Shah     Answered On: Oct 03

There are two ways.
One is in the VBA editor under ThisWorkbook,
create:
Private Sub Workbook_Open()
End Sub

The other is on one of the code Modules.
Create:

Sub Auto_Open()
End Sub

Either will work.

 
Answer #2    Answered By: Emma Campbell     Answered On: Oct 03

Moreover, do we have any option to close the user
form?

For example  : I am using a single userform for two or
more activity, Once I completed the activity the
userform should be closed (as like VB, Except
userform.hide option) and the values inthe controls
like textbox or combo box should be initilized. If I
hide the userform, if we use the same user form for
next operation the values in the controls are showing
in on the screen. Could you please help  me on this.

 
Answer #3    Answered By: Kellie Bishop     Answered On: Oct 03

How are you doing?

I have a quick question, Sorry to distrub you!!. In VB
we can perform  some action when we use ASCII values.
For example  : When we click on ctrl + S to save the
document.

In Excel macro, do we have such kind of operation? Can
we assign certain actions when we click on the button
as explained above.

Please explain me with your examples.

 
Answer #4    Answered By: Mona Wagner     Answered On: Oct 03

As with many programming languages, there are several ways of doing the
same thing.

Keep in mind that UserForm.Hide is exactly that. It's HIDDEN, but that does
not mean that it's not there. It's just not displayed.
When you call the userform again, you're not opening a new userform, you're
displaying the "hidden" one.

Check out these options:
First: The "Unload" statement.
This basically "hides" the userform and clears the values.
You may want to be sure you've read all of the values first.

Second: Use the Userform_Initialize subroutine for your userform
and clear all of the objects (or pre-populate them) whenever the
userform is opened.

 
Answer #5    Answered By: Eloise Lawrence     Answered On: Oct 03

Please rewrite your message giving much more consistent information about
what you want.

For instance, what is "... when we use ASCII values"? Do you simply mean
"... use the keyboard"?

If so, what do you mean in the next paragraph by "... the button as
explained above"?

Please explain exactly what you would like to do.

 
Didn't find what you were looking for? Find more on Performing some activity when loading the worksheet Or get search suggestion and latest updates.




Tagged: