Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro in sheet


Ok i have a macro that is written in a template workbook. The idea i
that the template is then copied into a variety of sheets and the macr
is run to pick up various pieces of standing data, what i am strugglin
with is a way of ensuring the macro stays with the sheet when it i
copied into a new work book.

Any ideas

--
chalk
-----------------------------------------------------------------------
chalky's Profile: http://www.excelforum.com/member.php...fo&userid=2375
View this thread: http://www.excelforum.com/showthread.php?threadid=56329

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default Macro in sheet

Put the macro inthe code module for the sheet that will be copied to the
other workbooks. The macro will be copied with the sheet.

If your macro is a user-defined function which is called from the worksheet,
the code must be in a VBA code module. The following link to Erlandsen Data
Consulting's VBA site has code for copying a module from one workbook to
another:

http://www.erlandsendata.no/english/...vbavbecopytowb

Hope this helps,

Hutch

"chalky" wrote:


Ok i have a macro that is written in a template workbook. The idea is
that the template is then copied into a variety of sheets and the macro
is run to pick up various pieces of standing data, what i am struggling
with is a way of ensuring the macro stays with the sheet when it is
copied into a new work book.

Any ideas?


--
chalky
------------------------------------------------------------------------
chalky's Profile: http://www.excelforum.com/member.php...o&userid=23758
View this thread: http://www.excelforum.com/showthread...hreadid=563293


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
Macro to lookup a sheet, number, then display in origonal sheet abbsy3 New Users to Excel 3 November 9th 10 12:19 PM
macro to: Add new sheet, then rename new sheet with todays date Paul Excel Worksheet Functions 3 September 29th 07 03:17 AM
Return to Current Sheet in On (sheet activate) event macro Paul Moles Excel Programming 1 March 27th 05 03:16 PM
2 questions, copying data from sheet to sheet and assigning macro Boris Excel Worksheet Functions 0 December 16th 04 06:11 PM
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet arunjoshi[_5_] Excel Programming 1 May 2nd 04 03:50 PM


All times are GMT +1. The time now is 12:03 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"