View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Embedding VBA in New Workbook

Patrick,

Use a template file for the "seperate workbook" that you open, modify by
adding data, and then save as under an apprpriate name. The file should
have all the code, buttons, etc., and will greatly simplify the task.

HTH,
Bernie
MS Excel MVP

"Patrick" wrote in message
...
I am writing code behind an Excel workbook that will interface with my
mainframe, extract purchase order data, write it to the sheet, categorize

it
by vendor, then write each vendor's data to a seperate workbook. Each new
workbook then gets sent to the specific vendor for updates to be made, is
sent back to me, and then populates the updated information back into the
mainframe.
My problem is that once I create each seperate vendor workbook I need to
embed the VBA code that allows that data to be sent back up into my
mainframe. Is there a way that I can have my main spreadsheet embed the
needed code (and command buttons) in the new sheets at the time they are
created?
Thanks!
patrick