PDA

View Full Version : Copying a worksheet content to 19 other WSs in the same WB



mugcy
03-25-2009, 09:54 PM
HI,

Is there a way to copy the contents of a worksheet(including formatting and formulas) to 19 other Worksheets on the same Workbook using VBA.

Can someone please help???

GTO
03-26-2009, 12:51 AM
Greetings Mugcy,

In a blank 3-page wb, throw a couple of formulas in sheet1 and try:

Sub ex()
Dim i As Long
For i = 1 To 19
With ThisWorkbook
.Worksheets(1).Copy Before:=.Worksheets(.Worksheets.Count - 1)
End With
Next

End Sub

This should make 19 copies of sheet 1, placing them in order after sheet 1.

I imagine you might want to name all the copies, but you didn't specify as to what you might want them to be named like.

Hope this helps,

Mark

mugcy
03-26-2009, 06:07 AM
THanks a lot for you help GT