ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   paste range from one sheet to each sheet after (https://www.excelbanter.com/excel-programming/428087-paste-range-one-sheet-each-sheet-after.html)

J.W. Aldridge

paste range from one sheet to each sheet after
 
Doesn't work....
Any clues?

Sub Macro1()
'
'copy range from template sheet
Sheets("Ind Templates").Select
Rows("38:50").Select
Selection.Copy

'for each sheet in workbook after "ind templates"
x = Sheets("Ind templates").Index
For Each Sh In ThisWorkbook.Sheets
If Sh.Index x Then

'paste the copied data 1row below the last row used
Range("A365").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Select
Selection.Paste


End If
Next

End Sub

Per Jessen[_2_]

paste range from one sheet to each sheet after
 
Hi

This should do it:

Sub Macro1()
'
Dim sh As Worksheet
'copy range from template sheet
Sheets("Ind Templates").Rows("38:50").Copy

'for each sheet in workbook after "ind templates"
x = Sheets("Ind Templates").Index
For Each sh In ThisWorkbook.Sheets
If sh.Index x Then
'paste the copied data 1row below the last row used
sh.Paste sh.Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
End If
Next
Application.CutCopyMode = False
End Sub

Hopes this helps.

---
Per

On 6 Maj, 21:40, "J.W. Aldridge" wrote:
Doesn't work....
Any clues?

Sub Macro1()
'
'copy range from template sheet
Sheets("Ind Templates").Select
Rows("38:50").Select
Selection.Copy

'for each sheet in workbook after "ind templates"
x = Sheets("Ind templates").Index
For Each Sh In ThisWorkbook.Sheets
If Sh.Index x Then

'paste the copied data 1row below the last row used
Range("A365").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Select
Selection.Paste

End If
Next

End Sub



J.W. Aldridge

paste range from one sheet to each sheet after
 
THANX!!!

....you're a life saver!

J.W. Aldridge

paste range from one sheet to each sheet after
 
purfecto!
thanx


All times are GMT +1. The time now is 09:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com