View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Destination:=.Cells(.Rows.Count, "A").End(xlUp).Row + 1

I think your code is mixing sheet references. See if this does what you
want...

Private Sub Workbook_NewSheet(ByVal Sh As Object)
Dim lngLastRow As Long
With Worksheets("Ind Templates")
.Range("A1:F13").Copy Destination:=Sh.Range("a1")
lngLastRow = Sh.Cells(Sh.Rows.Count, "A").End(xlUp).Row + 1
.Range("A39:F50").Copy Destination:=Sh.Range("A" & lngLastRow)
End With
End Sub

--
Rick (MVP - Excel)


"J.W. Aldridge" wrote in message
...
Mr. Jacob,

unfortunately, this didn't work.
Let me give you the full code that i am using...


Private Sub Workbook_newsheet(ByVal Sh As Object)
Dim LastRow As Long

With Worksheets("Ind Templates")
.Range("A1:f13").Copy _
Destination:=Sh.Range("a1")

With Worksheets("Ind Templates")
lngLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
.Range("A39:f50").Copy Destination:=.Range("a" & lngLastRow)

End With

End With

End Sub