New to the forums, please be easy
I have an Excel worksheet change macro set up for data entered in a specific column to auto sort at a couple of different locations in the sreadsheet. It's set up like this:
CONCRETE
Name | Data (this cell has a named reference of CONCSTART to indicate start for sort function)
Name | Data
Name | Data
MASONRY
Name | Data (this cell has a named reference of MASSTART to indicate start for sort function)
Name | Data
Name | Data
When data is entered into the data column, it auto sorts ascending. I've used this before, and have set it up again, but here's my issue. My sections sort independently of each other, and I have about 10 or so. Some of the sections sort fine, others wont sort, but I'm not getting a VBA error, and all my scripts match syntax wise.
Here is the code I'm using:
Any thoughts?
I'm using Excel 2000, and the worksheet I am modifying was created in 2007.
I have an Excel worksheet change macro set up for data entered in a specific column to auto sort at a couple of different locations in the sreadsheet. It's set up like this:
CONCRETE
Name | Data (this cell has a named reference of CONCSTART to indicate start for sort function)
Name | Data
Name | Data
MASONRY
Name | Data (this cell has a named reference of MASSTART to indicate start for sort function)
Name | Data
Name | Data
When data is entered into the data column, it auto sorts ascending. I've used this before, and have set it up again, but here's my issue. My sections sort independently of each other, and I have about 10 or so. Some of the sections sort fine, others wont sort, but I'm not getting a VBA error, and all my scripts match syntax wise.
Here is the code I'm using:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Check that cell changed was in col H. If not, exit.
If Target.Column <> 8 Then Exit Sub
'Sorts Concrete cells ascending by bid amount
Range("CONCRETE").Sort Key1:=Range("CONSTART"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
'Sorts Masonry cells ascending by bid amount
Range("MASONRY").Sort Key1:=Range("MASSTART"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Any thoughts?
I'm using Excel 2000, and the worksheet I am modifying was created in 2007.
Last edited: