View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Martin Wheeler Martin Wheeler is offline
external usenet poster
 
Posts: 57
Default Copy from workbook to workbook

xl2000
I am trying to update a lot of workbooks. I want to copy the formats and
formulas from a new workbook to all sheets named R* in the target workbook.
Below is my code so far.
Any help would be greatly appreciated.
Ta,
Martin

Public Sub CoPasTheLot()
Dim ws As Worksheet
Dim Source As Workbooks
Dim Target As Workbooks

Set Source = Workbooks("28Aug03")
Set Target = Workbooks("08Feb02")
For Each ws In Target
If Left(ws.Name, 1) = "R" Then
For Each ws In Target
Source.Worksheets("R1").Cells.Copy
Target.Worksheets(1).Cells.PasteSpecial xlFormats
Target.Worksheets(1).Cells.PasteSpecial xlFormulas
End If
Next
End Sub