Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to insert a certain number of row texts into 20 identical spreadsheets.
When I copy the area I want to insert then my macro stops after the first of the 20 sheets. I use "for x=1 to 20" "Next x" to acheive the repeated copy. Is there a simple way to get the result i want? -- Tomas S |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
By spreadsheets do you mean 20 different workbooks or do you mean 20
different sheets in 1 workbook. Also post your code. -- HTH... Jim Thomlinson "Tomas Stroem" wrote: I want to insert a certain number of row texts into 20 identical spreadsheets. When I copy the area I want to insert then my macro stops after the first of the 20 sheets. I use "for x=1 to 20" "Next x" to acheive the repeated copy. Is there a simple way to get the result i want? -- Tomas S |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
20 sheets in one Workbook
The code I have is the following. It solves the problem but on slow machines in the organisation it takes time as I make three loops ----------------------------------------------------------- ActiveSheet.Unprotect Password:="tomstr" Sheets("Pos A").Select For x = 1 To 20 ActiveSheet.Unprotect Password:="tomstr" Range("a31").Select ActiveSheet.Next.Select Next x Sheets("Parametrar").Select Range("b40:e77").Select Application.CutCopyMode = False Selection.Copy Sheets("Pos A").Select For x = 1 To 20 ActiveSheet.Paste ActiveSheet.Next.Select Next x Sheets("Pos A").Select For x = 1 To 20 Range("a12").Select Range("a2").Select Range("a1").Select ActiveSheet.Protect Password:="tomstr" ActiveSheet.Next.Select Next x Sheets("Projektbeskrivning").Select ActiveSheet.Protect Password:="tomstr" Range("a12").Select Range("a2").Select Range("a1").Select End Sub -- Tomas S "Jim Thomlinson" wrote: By spreadsheets do you mean 20 different workbooks or do you mean 20 different sheets in 1 workbook. Also post your code. -- HTH... Jim Thomlinson "Tomas Stroem" wrote: I want to insert a certain number of row texts into 20 identical spreadsheets. When I copy the area I want to insert then my macro stops after the first of the 20 sheets. I use "for x=1 to 20" "Next x" to acheive the repeated copy. Is there a simple way to get the result i want? -- Tomas S |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have you turned off any error handlers (such as on error resume next) .
then run it and see if you get an error. Do you have functions written in VBA used in your worksheet. If so, make sure they don't create an error or that it is handled. Your problem statement is very light on details or sample code. -- Regards, Tom Ogilvy "Tomas Stroem" wrote in message ... I want to insert a certain number of row texts into 20 identical spreadsheets. When I copy the area I want to insert then my macro stops after the first of the 20 sheets. I use "for x=1 to 20" "Next x" to acheive the repeated copy. Is there a simple way to get the result i want? -- Tomas S |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multiple functions, conditional functions | Excel Worksheet Functions | |||
How to convert cell formula functions to code functions | Excel Discussion (Misc queries) | |||
efficiency: database functions vs. math functions vs. array formula | Excel Discussion (Misc queries) | |||
Looking for a site with functions that substitute the ATP functions | Excel Worksheet Functions | |||
excel functions and User defined functions | Excel Programming |