Sub copylist16()
'
' textcopy Macro
' use customername and city for filename
' ok - has page title added first and returns you to cell a5
' 12 - save workbook as excel spreadshhet
Sheets("ORDERS").Select
Dim FP As String, FN As String, FJ As String
FP = "j:\copycutlist\" ' file path of where files will be saved
FN = Range("A2").Value ' file name from cell value - shipper name
FJ = Range("W2").Value ' filename from cell value - tops
Dim rLastRow As Range
Set rLastRow = Range("V:X").Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows)
If Not rLastRow Is Nothing Then
If rLastRow.Row >= 5 Then
Range("V5:X" & rLastRow.Row).Copy
Else
MsgBox "Doesn't appear to be much data on sheet!"
End If
Else
MsgBox "No data on sheet!"
End If
Workbooks.Add
Range("A1").Select
ActiveCell.FormulaR1C1 = "COMPANY NAME"
Range("A2").Select
ActiveCell.FormulaR1C1 = "ORDERS"
Range("A4").Select
ActiveCell.FormulaR1C1 = "Required"
Application.Goto Reference:="R5C1"
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("A" & rLastRow.Row + 2).Select
ActiveCell.FormulaR1C1 = "TITLE"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "TEXT"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "TEXT"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "TEXT"
ActiveCell.Offset(1, -2).Range("A1").Select
ActiveCell.FormulaR1C1 = "TEXT"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "TEXT"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "TEXT"
Application.CutCopyMode = False
Application.DisplayAlerts = False
Range("A5").Select
ActiveWorkbook.SaveAs Filename:= _
FP & FN & FJ & ".txt", FileFormat:=xlTextMSDOS, _
CreateBackup:=False
ActiveWorkbook.SaveAs Filename:= _
FP & FN & FJ & ".xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
'
End Sub