I ahve the following code that is erroring on my ".copy" line fo code. does anyone knwo why?
Code:
Sub CompleteForms()
Dim Vendor As String
Dim CurrentRow As String
Dim CurrentColumn As String
Dim PasteRangeName As String
Dim XXX As String
Dim Edate As String
i = Sheets("data").Range("A2").End(xlDown).Row
For Each cell In Sheets("data").Range("A2:R" & i)
On Error Resume Next
CurrentRow = Row
Vendor = Sheets("Data").Range(A & CurrentRow)
Sheets("Template").Copy After:=Sheets(2)
Sheets("Template (2)").Name = Vendor
CurrentColumn = Column
PasteRangeName = Sheets("data").Range(CurrentColumn & "1").Value
.Copy
Sheets(Vendor).Range(PasteRangeName).PasteSpecial xlValue
Edate = Sheets(Vendor).Range(Edate).Value
XXX = Format(Edate, "[$-409]ddmmmyyyy;@")
Next
Folder = "C:\Users\tphythian\Documents\Vendor Evaluations"
ThisWorkbook.Worksheets(Vendor).Copy
With ActiveSheet.UsedRange
.Value = .Value
End With
With ActiveWorkbook
.SaveAs Folder & "\" & Vendor & " - " & XXX & ".xlsx"
.Close
End With
Sheets(Vendor).Delete
End Sub