PC Review


Reply
Thread Tools Rate Thread

Adding a macro to all new workbooks

 
 
AndrewArmstrong
Guest
Posts: n/a
 
      12th Oct 2006
I have a master workbook that creates other workbooks via VBA. Each new
workbook has a forms toolbar button. I have assigned a macro to the
button using

Set btn = ActiveSheet.Buttons.aDD(460, 1, 100, 25)
btn.OnAction = "AddInterface"
btn.Characters.Text = "Add Interface"

This seems to reference back to the macro on the sheet that is creating
the workbook. I would like each new workbook to contain a module with
the VBA code I have written, called "AddInterface", that does not
require the master sheet. Any ideas?? Thanks in advance!

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      12th Oct 2006
Create a template with that code, and when adding workbooks, use the
template

Workbooks.Add template_path_and_name

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"AndrewArmstrong" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a master workbook that creates other workbooks via VBA. Each new
> workbook has a forms toolbar button. I have assigned a macro to the
> button using
>
> Set btn = ActiveSheet.Buttons.aDD(460, 1, 100, 25)
> btn.OnAction = "AddInterface"
> btn.Characters.Text = "Add Interface"
>
> This seems to reference back to the macro on the sheet that is creating
> the workbook. I would like each new workbook to contain a module with
> the VBA code I have written, called "AddInterface", that does not
> require the master sheet. Any ideas?? Thanks in advance!
>



 
Reply With Quote
 
AndrewArmstrong
Guest
Posts: n/a
 
      12th Oct 2006
Thanks Bob! I'll give it a shot and let you know how it turns out. I
really appreciate the help!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding like cells from different workbooks Mr B Microsoft Excel Worksheet Functions 1 22nd Jan 2009 10:25 PM
Adding data from different workbooks Bev Microsoft Excel Worksheet Functions 3 8th Jan 2009 09:07 PM
Updating workbooks by adding elements of other workbooks? StargateFan Microsoft Excel Discussion 0 11th Aug 2008 06:06 AM
Macro for EACH workbook-->help modify to ONE macro for ALL workbooks? dk_ Microsoft Excel Discussion 23 5th Jun 2007 01:22 PM
adding cells from different workbooks joeldsmt Microsoft Excel Worksheet Functions 7 17th Jul 2004 01:59 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:44 AM.