简体   繁体   中英

Copy and Paste a range from one worksheet to multiple worksheets

I am trying to copy a range from one worksheet to about 600 more worksheets in the same workbook.

I have found some code that enables me to copy the range and paste it at the end of the next worksheet. The code below only pastes the range to 1 worksheet (Sheet3). But I am unable to figure out how to loop it to paste in all the other worksheets. How can I add a loop to the code below to to do so?

Sub copypaste()
Dim i As Long
With Sheets("Sheet3")
i = .Range("B" & Rows.Count).End(3).Row
Sheets("Cert").Range("A1:K27").Copy .Range("A" & i + 1)
End With
End Sub

If by 600 worksheets, you mean that you would like to copy to all the worksheets, then consider:

For Each WS In Worksheets
  With WS
  i = .Range("B" & Rows.Count).End(3).Row
  Sheets("Cert").Range("A1:K27").Copy .Range("A" & i + 1)
  End With
Next WS

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM