Expanding ranges after sort???

S

Simon Lloyd

Happy New Year to you all!

I have named ranges from rows D2 - X30, D31 - X50 and D51 - X80 (name
first, second and third) at the bottom of these (from A80 downward)
have some formatted rows that can have data entered, when the AutoClos
runs it sorts all the rows by date (the dates for all ranges appear i
column A) but when a row is taken from the extra area (below A80) an
sorted in date order and inserted into one of the named ranges (let
say FIRST) then the range expands but moves the other ranges out (i.
FIRST would now be D2 - X31 and SECOND would be D32 - X51) and this i
causing problems with calulations that are taken from these cells, I
there anyway to cure this problem?

Any thoughts or help will be greatfully recieved.

Thanks,

Simo
 
S

Simon Lloyd

As requested here is the AutoClose,

Sub auto_close()

Sheets("Holidays").Select
ActiveSheet.Unprotect
EnableEvents = False
With Application
..EnableEvents = False
..Calculation = xlManual
..MaxChange = 0.001
..CalculateBeforeSave = False
End With
ActiveWorkbook.PrecisionAsDisplayed = False
Range("A14:AK545").Select
Selection.sort Key1:=Range("A14"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,
_
DataOption1:=xlSortNormal
Range("a1").Select
Application.DisplayAlerts = False
Application.DisplayFormulaBar = True
ActiveCell = xlNone

With Application
..Calculation = xlAutomatic
End With
ActiveSheet.Protect

ActiveWorkbook.Save
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top