Code:
Sub ResNoSort()
lastRow = Cells(Rows.Count, 1).End(xlUp).Row - 1
ActiveSheet.Unprotect Password:="password"
Rows("6:" & lastRow).Select
ActiveSheet.Sort.SortFields.Clear
ActiveSheet.Sort.SortFields.Add Key:=Range("B6:B" & lastRow) _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveSheet.Sort
.SetRange Range("A6:EZ" & lastRow)
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("B6").Select
ActiveSheet.Protect Password:="password", AllowFormattingCells:=True
End Sub
When I run the above code, sometimes(!) it changes the row height of row 47 to zero...................
I cant replicate it reliably, and I have amended the code to reset the row height now, but any ideas why this could be, or is it just a bug?
TIA