Inserting a sub

G

Guido Massaro

Could anyone tell me how i can insert a sub in a excell
sheet.
I have found a sub, i copy the text and now i like to put
it into excell so i can use it everytime.
 
B

BrianB

Not sure what you mean. A subroutine must go into a code modul
contained in a workbook. With the workbook open use keys Alt +F11 t
open the VB Editor. Use menu Insert/Module and copy/paste the code t
there. If you want the code page for a specific worksheet, right clic
the sheet tab and select "View Code"
 
G

Gord Dibben

Guido

Depends upon what type of Sub you have copied.

Event code will go into either the worksheet or Workbook module.

Regular Subs could be placed into a standard module.

To make the regular Sub available for all open workbooks, it would be placed
into your Personal.xls or an add-in(*.XLA).

See David McRitchie's site for info on getting started with macros.

http://www.mvps.org/dmcritchie/excel/getstarted.htm

OR post the code. Someone could tell you where to place it.

Gord Dibben Excel MVP
 
Top