Josel,
Thanks for the workbook. I am not going to display any screenshots because some of the information may be sensative.
The macro has been adjust to compensate for no data in a worksheet except for the title row.
Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).
1. Copy the below code, by highlighting the code and pressing the keys
CTRL +
C
2. Open your workbook
3. Press the keys
ALT +
F11 to open the Visual Basic Editor
4. Press the keys
ALT +
I to activate the Insert menu
5. Press
M to insert a Standard Module
6. Where the cursor is flashing, paste the code by pressing the keys
CTRL +
V
7. Press the keys
ALT +
Q to exit the Editor, and return to Excel
8. To run the macro from Excel, open the workbook, and press
ALT +
F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
Code:
Option Explicit
Sub CreateSummaryV2()
' hiker95, 05/20/2011
' http://www.mrexcel.com/forum/showthread.php?t=551416
Dim wS As Worksheet, w As Worksheet
Dim LR As Long, NR As Long
Application.ScreenUpdating = False
If Not Evaluate("ISREF(Summary!A1)") Then Worksheets.Add(Before:=Worksheets(1)).Name = "Summary"
Set wS = Worksheets("Summary")
wS.UsedRange.Clear
With wS.Range("A1:J1")
.Value = [{"Date","Name","Race","Sex","Position Applied For","Referral Source","Disposition","Job Title","Date of Hire","EEO Cat."}]
.HorizontalAlignment = xlCenter
.Font.FontStyle = "Bold"
End With
For Each w In ThisWorkbook.Worksheets
If w.Name <> "Summary" Then
LR = w.Cells(Rows.Count, 1).End(xlUp).Row
If LR > 1 Then
NR = wS.Range("A" & Rows.Count).End(xlUp).Offset(1).Row
wS.Range("A" & NR).Resize(LR - 1, 10).Value = w.Range("A2").Resize(LR - 1, 10).Value
End If
End If
Next w
wS.Range("A2:A" & NR).NumberFormat = "m/d/yyyy"
wS.UsedRange.Columns.AutoFit
wS.Activate
Application.ScreenUpdating = True
End Sub
B