Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
What to do to run macro on sheet1 to sheet10
I have macro, which i want to run on sheet1 to sheet10 by one go.
|
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
What to do to run macro on sheet1 to sheet10
try this
Sub all_sheet() Dim ws As Workbook For x = 1 To Worksheets.Count Sheets(x).Select 'your code........ Next End Sub On Oct 17, 3:53*pm, Harshad wrote: I have macro, which i want to run on sheet1 to sheet10 by one go. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
What to do to run macro on sheet1 to sheet10
How about something like this? This assumes that you want to do something to
every sheet. If you don't, let me know. Sub Test() Dim WS As Worksheet Dim WB As Workbook For Each WS In WB.Worksheets Call PerformStuff(WS) Next WS End Sub Sub PerformStuff(WS As Worksheet) 'Put your "stuff" in here WS.Cells(1, 1).Value = 1 End Sub -- HTH, Barb Reinhardt If this post was helpful to you, please click YES below. "Harshad" wrote: I have macro, which i want to run on sheet1 to sheet10 by one go. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
What to do to run macro on sheet1 to sheet10
I forgot to include this
Set WB = ActiveWorkbook -- HTH, Barb Reinhardt If this post was helpful to you, please click YES below. "Harshad" wrote: I have macro, which i want to run on sheet1 to sheet10 by one go. |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
What to do to run macro on sheet1 to sheet10
This will perform on sheets as they are arranged in the workbook. Post YOUR
code for comments along with which 10 sheets you want. Or, do you only have 10 sheets? More detail. Sub doeachsheet() For i = 1 To 3 MsgBox Sheets(i).Name MsgBox Sheets(i).Range("a1") Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Harshad" wrote in message ... I have macro, which i want to run on sheet1 to sheet10 by one go. |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
What to do to run macro on sheet1 to sheet10
Daer all,
My workbook cointain54 sheets. i don't want to run all the macro to each sheet. Some descreption: Sheet names in ascending order a Main, Content, Micro, Help, NN1, NN2,....,NN50. I have macros name: Main, Content, Micro1, Micro2, Help, NNA, NNB, NNC. I have solved to run Main, Content, Micro and Help macro by following code. Sheets("Sheet Name").Activate But problem is for remaining Three Macro NNA, NNB and NNC. NNA, NNB and NNC are What i should put in a code, that runs my all three NN* macro through sheet NN1 to NN50. "Harshad" wrote: I have macro, which i want to run on sheet1 to sheet10 by one go. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Copy data from a list in sheet1 and paste into sheet2 | Excel Discussion (Misc queries) | |||
[=Sheet1!A1] - if i use Column A1 ('Sheet1') / A2 ('Sheet2') | Excel Worksheet Functions | |||
Using Macro, want to group all Worksheets, but Sheet1,How? | Excel Discussion (Misc queries) | |||
Macro-Copy various cells in sheet1 into next available row in sheet 2 | Excel Discussion (Misc queries) | |||
Modifying Sheet1 macro to run on Sheet2 | Excel Discussion (Misc queries) |