Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to affect all sheets
I want to select all sheets in a workbook, insert a column, and put a formula
in that column. It works fine when doing it manually, but if I try to have a macro do this, it only affects one sheet. Is there any way to do this? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to affect all sheets
The general principal is shown in the following code.
Pls note: the code places the formula: =2+2 in cell F1 of every sheet. I'm sure it will b no problem 4 u yo change it 4 your needs. ----------------------- Sub All_Sheets() For Each SH In ActiveWorkbook.Sheets SH.[F1].Formula = "=2+2" Next End Sub ------------- Micky "REMB" wrote: I want to select all sheets in a workbook, insert a column, and put a formula in that column. It works fine when doing it manually, but if I try to have a macro do this, it only affects one sheet. Is there any way to do this? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to affect all sheets
I know that it doesn't make sense but Excel will NOT accept all sheets in a macro for this. Use the suggested loop. Fast -- Don Guillett Microsoft MVP Excel SalesAid Software "REMB" wrote in message ... I want to select all sheets in a workbook, insert a column, and put a formula in that column. It works fine when doing it manually, but if I try to have a macro do this, it only affects one sheet. Is there any way to do this? |
#4
|
|||
|
|||
Have you tried recording the Macro on Sheet 1 first, then holding down shift, and hilighting all tabs and running the Macro?
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting Rows and the affect on Functions | Excel Worksheet Functions | |||
How does 1 value affect the average? | Excel Worksheet Functions | |||
How do business loans affect the p & l? | Excel Discussion (Misc queries) | |||
How can I Run a query from VB macro with out affect current data in the same sheet? | Excel Discussion (Misc queries) | |||
inserta row and affect same formula on same sheet | Excel Worksheet Functions |