View Single Post
  #18   Report Post  
Posted to microsoft.public.excel.programming
Living the Dream Living the Dream is offline
external usenet poster
 
Posts: 151
Default Formatting multiple sheets within workbook.

Garry & Claus

Just wanted to say thank you to both of you for your guidance. I decided to forego the Exclusion list and went with a table list.

Ran it tonight at work and it went very well. Here is what I ended up with just in case anyone in the future may look at doing something similar.

Sub Sheet_Magic()

Dim rng, c
Dim RSrng, rCell
Dim sh As Worksheet

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

Set RSrng = Sheets("Route Summary").Range("A5:A43")

For Each rCell In RSrng

On Error Resume Next
If Not rCell.Value Is Nothing Then Sheets("" & rCell).Activate
On Error GoTo 0

With ActiveSheet
Set rng = .Range("A10:O26")
rng.Borders(xlEdgeBottom).LineStyle = xlNone
rng.Sort key1:=.Range("F10"), order1:=xlAscending, Header:=xlYes

For i = 11 To 26
If .Cells(i + 1, "A") < .Cells(i, "A") Then
With .Range(.Cells(i, 1), .Cells(i, 14))
With .Borders(xlEdgeBottom)
.LineStyle = xlDouble
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThick
End With
End With
End If
Next
For i = 26 To 11 Step -1
If Len(.Cells(i, 1)) = 0 Then
.Rows(i).Delete
End If
Next
End With
Next rCell

With Application
.ScreenUpdating = True
.EnableEvents = True
End With

End Sub