Sub GTS()
'
' GTS Macro
' Macro recorded 2/25/2008 by Matt Loflin
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.Calculation = xlManual
Dim NewName As String
Dim x As String
x = Application.ActiveWorkbook.FullName
OldX = Application.ActiveWorkbook.Name
' Rename Full Filename
If Right((x), 8) = " GTS.xls" Then
NewName = Left((x), Len(x) - 8) & " GTS" & ".xls"
Else
NewName = Left((x), Len(x) - 4) & " GTS" & ".xls"
End If
'Add New Workbook / Save New Name
Workbooks.Add
ActiveWorkbook.SaveAs NewName
NewX = Application.ActiveWorkbook.Name
'Copy and Paste Columns
Windows(OldX).Activate
Columns("A:A").Copy
Windows(NewX).Activate
Columns("F:F").Select
ActiveSheet.Paste
Windows(OldX).Activate
Columns("M:M").Copy
Windows(NewX).Activate
Columns("B:B").Select
ActiveSheet.Paste
Windows(OldX).Activate
Columns("J:J").Copy
Windows(NewX).Activate
Columns("D:D").Select
ActiveSheet.Paste
'Delete Empty Rows
newlastrow = Range("b" & ActiveSheet.Rows.Count).End(xlUp).Row
Range("A1:A" & newlastrow).Value = "PROBEPOINTTEST,"
Range("C1:C" & newlastrow).Value = ",COLOR,"
Range("E1:E" & newlastrow).Value = ",LABEL,"
Dim ocell As Range
For i = newlastrow To 2 Step -1
If Left(Range("b" & i), 2) <> "J1" And _
Left(Range("b" & i), 2) <> "J2" And _
Left(Range("b" & i), 2) <> "J3" Then
Range(i & ":" & i).EntireRow.Delete
End If
If Left(Range("b" & i), 2) = "J1" Or _
Left(Range("b" & i), 2) = "J2" Or _
Left(Range("b" & i), 2) = "J3" Then
Cells(i, 2).Value = "$" & Cells(i, 2).Value
End If
Next i
Rows(1).Delete
lastrow = Range("b" & ActiveSheet.Rows.Count).End(xlUp).Row
Rows(lastrow + 1).Delete
Rows(1).Insert shift:=xlDown
Cells(1, 1) = "Begin"
Rows(1).Insert shift:=xlDown
Cells(1, 1).Value = "INSTRUCTIONS"
Cells(lastrow + 3, 1).Value = "END"
Columns("A:F").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Application.Calculation = xlAutomatic
ActiveWorkbook.Save
End Sub