View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Formatting multiple sheets within workbook.

Hi Mark,

Am Thu, 30 Mar 2017 06:16:50 -0700 (PDT) schrieb Living the Dream:

1. If there are no Blank rows to delete, the code halts.
( probably need an exit if criteria not met ).
2. It won't sort now
( most likely has to do with overall used range, as will not always be rows 11 to 26, sometimes more, sometimes less).
3. the double-lines don't appear as before.
( clueless as to why this has stopped working ).


try:

For Each sh In ActiveWorkbook.Sheets
If InStr(sExclShts, sh.Name) Then
With sh
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 i
End With
End If
Next sh


Regards
Claus B.
--
Windows10
Office 2016