Where did you place the macro? There are three types of "modules". "Standard" modules "Worksheet" modules "Workbook" modules Macros stored in a "sheet" module are only accessible to the sheet itself. Thisworkbook is a "workbook" module. usually, this module is used for "event" macros that apply to the entire workbook. if you want a macro to be available to all sheets, you should place it in a "standard" module. (made by right-clicking in the "project" window and select Insert->Module) Using the keyword "Public" as in: Public Sub WEBADDcheck_up() would actually make the macro available to other workbooks... hope this helps.
Paul ----------------------------------------- “Do all the good you can, By all the means you can, In all the ways you can, In all the places you can, At all the times you can, To all the people you can, As long as ever you can.” - John Wesley ----------------------------------------- From: Johnny <flem...@gmail.com> >To: excel-macros@googlegroups.com >Sent: Tuesday, January 20, 2015 12:51 PM >Subject: $$Excel-Macros$$ Running a macro on multiple worksheets (code >included) > > > >Hi all, I've read through several threads to come up with the code below, >regarding having a macro operate on all the worksheets in a workbook. >I hope I'm missing something simple here. The workbook has 14 tabs, but the >code only runs in the tab where I initiate the macro. Any help is very much >appreciated. > >Thanks >John > >------- > >Sub WEBADDcheck_up() > >Application.ScreenUpdating = False >Application.Calculation = xlCalculationManual > >Dim WS As Worksheet >For Each WS In ActiveWorkbook.Worksheets > > 'DeleteRowsWebadd > Rows("61:72").Delete shift:=xlUp > Rows("59:59").Delete shift:=xlUp > Rows("53:54").Delete shift:=xlUp > Rows("39:51").Delete shift:=xlUp > Rows("30:33").Delete shift:=xlUp > Rows("26:28").Delete shift:=xlUp > Rows("7:17").Delete shift:=xlUp > Rows("1:1").Delete shift:=xlUp > > Rows("1:1").Select > With Selection > .HorizontalAlignment = xlGeneral > .VerticalAlignment = xlBottom > .Orientation = 70 > .IndentLevel = 0 > .ReadingOrder = xlContext > End With > Cells.Select > With Selection.Font > .Name = "Calibri" > .Size = 10 > .Underline = xlUnderlineStyleNone > .ColorIndex = xlAutomatic > .TintAndShade = 0 > .ThemeFont = xlThemeFontMinor > End With > > ActiveSheet.[a1] = ActiveSheet.Name > > Cells(1, 1).Select > With Selection > .HorizontalAlignment = xlCenter > .VerticalAlignment = xlCenter > .Orientation = 0 > End With > With Selection.Font > .Name = "Calibri" > .FontStyle = "Bold" > .Size = 14 > End With > With Selection.Interior > .Pattern = xlSolid > .PatternColorIndex = xlAutomatic > .ThemeColor = xlThemeColorAccent5 > .TintAndShade = 0.599963377788629 > .PatternTintAndShade = 0 > End With > > Cells.Select > Cells.EntireColumn.AutoFit > > Next WS > >Application.Calculation = xlCalculationAutomatic >Application.ScreenUpdating = False > >End Sub -- >Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s >=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ >https://www.facebook.com/discussexcel > >FORUM RULES > >1) Use concise, accurate thread titles. Poor thread titles, like Please Help, >Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get >quick attention or may not be answered. >2) Don't post a question in the thread of another member. >3) Don't post questions regarding breaking or bypassing any security measure. >4) Acknowledge the responses you receive, good or bad. >5) Jobs posting is not allowed. >6) Sharing copyrighted material and their links is not allowed. > >NOTE : Don't ever post confidential data in a workbook. Forum owners and >members are not responsible for any loss. >--- >You received this message because you are subscribed to the Google Groups "MS >EXCEL AND VBA MACROS" group. >To unsubscribe from this group and stop receiving emails from it, send an >email to excel-macros+unsubscr...@googlegroups.com. >To post to this group, send email to excel-macros@googlegroups.com. >Visit this group at http://groups.google.com/group/excel-macros. >For more options, visit https://groups.google.com/d/optout. > > > -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout.