Hi Adrian,
Try this:
Sub Adrian(): Dim wa As Worksheet, ws As Worksheet, r As Long, s As Long, PI As String
Set wa = ActiveSheet: For Each ws In Worksheets
If ws.name = "Summary" Then GoTo SetSummary
Next
Worksheets.Add(Before:=Worksheets(1)).name = "Summary"
SetSummary: Set ws = Sheets("Summary"): ws.Columns(1).ColumnWidth = 36: s = 2
ws.Columns(1).HorizontalAlignment = xlCenter
For r = 2 To wa.Range("A" & Rows.Count).End(xlUp).row: PI = Replace(wa.Cells(r, 12), "-", "")
PI = Left(PI, 3) & "-" & Mid(PI, 4, 3) & "-" & Right(PI, 4)
PI = wa.Cells(r, 3) & Chr(10) & _
wa.Cells(r, 4) & " , " & wa.Cells(r, 5) & " " & wa.Cells(r, 6) & Chr(10) & _
wa.Cells(r, 7) & Chr(10) & PI 'wa.Cells(r, 12)
ws.Cells(s, 1) = PI: s = s + 1
Next r
End Sub
Directions for running the routine(s) just supplied
If you haven't used macros before you'll need to go to:
File- options - trust center -trust center settings - macro settings ,
the second option down (disable all macros with notification)
Then - Copy the code to the clipboard
Open your Workbook
Press ALT + F11 to open the Visual Basic Editor.
Select "Module" from the Insert menu
Type "Option Explicit" then paste the code under it
With the cursor between Sub and End Sub press F5 (F8 to Single Step)
OR
Press ALT + Q to close the code window.
Press ALT + F8 then double click on the macro name
Bookmarks