How to apply macros to entire workbook

S

Sherry

I would like to know how to apply a macro to an entire workbook. I created a
macro within a worksheet. I would like to apply it to every sheet without
having to go each sheet and run the macro. Is there an easy way of doing
this? I am not a programmer...

Thanks!
 
G

Gord Dibben

Post your code.

A macro usually in placed into a General Module.

Event code will be placed in a worksheet or Thisworkbook module.

Do you mean you want a macro like this which works on all sheets in the workbook
when you run it once?

Sub Path_All_Sheets()
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.RightFooter = ActiveWorkbook.FullName & " " & Chr(13) _
& Application.UserName & " " & Date
Next
End Sub


Gord Dibben MS Excel MVP
 
F

FSt1

hi
if it's a sheet macro..no. the code has to be in a standard module or a this
workbook module for you to apply it to the entire work book.
post your code.

Regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top