|
-
Dec 10th, 2003, 09:19 PM
#1
Thread Starter
New Member
How to call a macro in Excel when creating a new sheet or file
Hi,
In excel when creating new file (Ctr+N) or new sheet I'd like to call a macro in Personal Workbook.
Is there anyone can help ?
In fact the macro i'd like to call is a macro to format the sheet (just been created) as I wish.
Thank a lot.
Cheers
-
Jan 7th, 2004, 05:25 AM
#2
Addicted Member
WORKBOOK
1. You could have a pre-formatted template
2. Why not just add a toolbar button to create the new workbook and format or copy the template.
3. Putting a pre-formatted workbook into your XLSTART folder and calling it book.xlt will do the job - but you might not need this for every new book.
WORKSHEET
Doubleclick ThisWorkBook in VB Editor and use the NewSheet event. (include this code in your template).
'----------------------------------------
Private Sub Workbook_NewSheet(ByVal Sh As Object)
End Sub
'------------------------------------------
Regards
BrianB
-------------------------------
-
Jan 8th, 2004, 12:49 AM
#3
Thread Starter
New Member
Thank you for your clear post.
However, I've found a way to create a default template.
It is : I create a file , format as I wish then Save as a template to the location , for example :
C:\Documents and Settings\chien\Application Data\Microsoft\Excel\XLSTART\Book.xlt
The Every time I create a new Workbook It'll have the same format as the template.
Thank again.
Cheers
Chien
-
Jan 8th, 2004, 06:20 AM
#4
Addicted Member
... which is included in my post .... <<grin>>.
Regards
BrianB
-------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|