Hello vba guru's, I'm trying to add at the end of a vba macro to take the active worksheet and then copy it, then add it to
another workbook. I've tried a couple of things and I searched but I just can't get it completely. Below is a portion of
vba code that goes through a worksheet and formats it, with header/footers, column headings...ect. Some of which I recieved
help from this site and others I recorded and modified...but this one last step is failing me?!
I tried this:
With Workbooks("Closed District Lead Summary Jan to Mar 2011.xls")
Before:=Workbooks("K:PROJNexTouch2010 ReportsVersions" & "" & "District Lead
Summary " & Format(Now, "yyyy-mm-dd") & ".xls").Sheets(1)
ReportsVersions" & "" & "District Lead Summary " & Format(Now, "yyyy-mm-dd")
Thanks for looking!
By the way, the 'other workbook' is a workbook that is already created, I want to add the one
sheet or tab to this already created workbook. I did find some code from Lieth Roth but that code was creating a new
workbook. Here's the code I found in this formn...perhaps this can be modified for my needs?
Dim FileSpec As String
Dim Ia As Integer
Dim NewWkb As Workbook
Dim Wksa As Worksheet
Dim WksName As String
With ThisWorkbook.Worksheets(NewSh) '("Replicator")
FileSpec = .Range("A1")
FileSpec = IIf(Right(FileSpec, 1) <> "", FileSpec & "", FileSpec)
FileSpec = FileSpec & .Range("A2")
For Ia = 1 To .Range("A3")
WksName = .Cells(I + 3, "A")
Set Wksa = ThisWorkbook.Worksheets(WksName)
If NewWkb Is Nothing Then
Set NewWkb = ActiveWorkbook
NewWkb.SaveAs fn 'FileSpec
UPDATED - - - I think I found the answer, I record the 'copy' via the normal fashion then added that
recored code to the existing code....first test seemed to work well....
Sheets(NewSh).Copy After:=Workbooks( _
"District Lead Summary 2011-03-17.xls").Sheets(1)