close

I'm sure this is a very easy one but I'm not too well versed on Macros /
VBA.

I have a worksheet with ever expanding data - rows at the bottom of the data
are continually added. I have a simple macro that sorts all of the data
according to preset parameters and selects the next blank cell in column A,
ready for more data:

Sub Macro5()
Range(quot;SortRangequot;).Select
Selection.Sort Key1:=Range(quot;SortRangequot;), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom
Do Until ActiveCell.Value = IsEmpty(True)
ActiveCell.Offset(1, 0).Activate
Loop
End Sub

When running the Macro, this leaves all of the cells in the range 'selected'
(ie; coloured-over). What do I need to add to the Macro to just select the
cell in Column A and remove the highlighting from all the other cells?

Thanks.
try
Sub sortsortrange()
Range(quot;SortRangequot;).Sort Key1:=Range(quot;SortRangequot;), _
Order1:=xlAscending
End Sub--
Don Guillett
SalesAid Software

quot;Terry Bennettquot; gt; wrote in message
...
gt; I'm sure this is a very easy one but I'm not too well versed on Macros /
gt; VBA.
gt;
gt; I have a worksheet with ever expanding data - rows at the bottom of the
gt; data are continually added. I have a simple macro that sorts all of the
gt; data according to preset parameters and selects the next blank cell in
gt; column A, ready for more data:
gt;
gt; Sub Macro5()
gt; Range(quot;SortRangequot;).Select
gt; Selection.Sort Key1:=Range(quot;SortRangequot;), Order1:=xlAscending, Header:=
gt; _
gt; xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
gt; xlTopToBottom
gt; Do Until ActiveCell.Value = IsEmpty(True)
gt; ActiveCell.Offset(1, 0).Activate
gt; Loop
gt; End Sub
gt;
gt; When running the Macro, this leaves all of the cells in the range
gt; 'selected' (ie; coloured-over). What do I need to add to the Macro to
gt; just select the cell in Column A and remove the highlighting from all the
gt; other cells?
gt;
gt; Thanks.
gt;
Doesn't seem very keen on this. Am I adding on to the end of the existing
script?

quot;Don Guillettquot; gt; wrote in message
...
gt; try
gt; Sub sortsortrange()
gt; Range(quot;SortRangequot;).Sort Key1:=Range(quot;SortRangequot;), _
gt; Order1:=xlAscending
gt; End Sub
gt;
gt;
gt; --
gt; Don Guillett
gt; SalesAid Software
gt;
gt; quot;Terry Bennettquot; gt; wrote in message
gt; ...
gt;gt; I'm sure this is a very easy one but I'm not too well versed on Macros /
gt;gt; VBA.
gt;gt;
gt;gt; I have a worksheet with ever expanding data - rows at the bottom of the
gt;gt; data are continually added. I have a simple macro that sorts all of the
gt;gt; data according to preset parameters and selects the next blank cell in
gt;gt; column A, ready for more data:
gt;gt;
gt;gt; Sub Macro5()
gt;gt; Range(quot;SortRangequot;).Select
gt;gt; Selection.Sort Key1:=Range(quot;SortRangequot;), Order1:=xlAscending, Header:=
gt;gt; _
gt;gt; xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
gt;gt; xlTopToBottom
gt;gt; Do Until ActiveCell.Value = IsEmpty(True)
gt;gt; ActiveCell.Offset(1, 0).Activate
gt;gt; Loop
gt;gt; End Sub
gt;gt;
gt;gt; When running the Macro, this leaves all of the cells in the range
gt;gt; 'selected' (ie; coloured-over). What do I need to add to the Macro to
gt;gt; just select the cell in Column A and remove the highlighting from all the
gt;gt; other cells?
gt;gt;
gt;gt; Thanks.
gt;gt;
gt;
gt;
did you try it?
I assume that quot;sortrangequot; is a defined name that will automatically adjust
with each entry
something like.
=offset($a$1,0,0,counta(a:a),5)

Sub sortsortrange()'I added a line
Range(quot;SortRangequot;).Sort Key1:=Range(quot;SortRangequot;), _
Order1:=xlAscending
Range(quot;sortrangequot;).End(xlDown).offset(1).Select
End Sub
--
Don Guillett
SalesAid Software

quot;Terry Bennettquot; gt; wrote in message
...
gt; Doesn't seem very keen on this. Am I adding on to the end of the existing
gt; script?
gt;
gt; quot;Don Guillettquot; gt; wrote in message
gt; ...
gt;gt; try
gt;gt; Sub sortsortrange()
gt;gt; Range(quot;SortRangequot;).Sort Key1:=Range(quot;SortRangequot;), _
gt;gt; Order1:=xlAscending
gt;gt; End Sub
gt;gt;
gt;gt;
gt;gt; --
gt;gt; Don Guillett
gt;gt; SalesAid Software
gt;gt;
gt;gt; quot;Terry Bennettquot; gt; wrote in message
gt;gt; ...
gt;gt;gt; I'm sure this is a very easy one but I'm not too well versed on Macros /
gt;gt;gt; VBA.
gt;gt;gt;
gt;gt;gt; I have a worksheet with ever expanding data - rows at the bottom of the
gt;gt;gt; data are continually added. I have a simple macro that sorts all of the
gt;gt;gt; data according to preset parameters and selects the next blank cell in
gt;gt;gt; column A, ready for more data:
gt;gt;gt;
gt;gt;gt; Sub Macro5()
gt;gt;gt; Range(quot;SortRangequot;).Select
gt;gt;gt; Selection.Sort Key1:=Range(quot;SortRangequot;), Order1:=xlAscending,
gt;gt;gt; Header:= _
gt;gt;gt; xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
gt;gt;gt; xlTopToBottom
gt;gt;gt; Do Until ActiveCell.Value = IsEmpty(True)
gt;gt;gt; ActiveCell.Offset(1, 0).Activate
gt;gt;gt; Loop
gt;gt;gt; End Sub
gt;gt;gt;
gt;gt;gt; When running the Macro, this leaves all of the cells in the range
gt;gt;gt; 'selected' (ie; coloured-over). What do I need to add to the Macro to
gt;gt;gt; just select the cell in Column A and remove the highlighting from all
gt;gt;gt; the other cells?
gt;gt;gt;
gt;gt;gt; Thanks.
gt;gt;gt;
gt;gt;
gt;gt;
gt;
gt;
Don - correct assumption re 'SortRange'.

Sorry, but could you tell me exacty what amendments to make to the code I
listed below? As mentioned, I am a novice at VBA and I don't understand
what you're suggesting.

Thanks.

quot;Don Guillettquot; gt; wrote in message
...
gt; did you try it?
gt; I assume that quot;sortrangequot; is a defined name that will automatically adjust
gt; with each entry
gt; something like.
gt; =offset($a$1,0,0,counta(a:a),5)
gt;
gt; Sub sortsortrange()'I added a line
gt; Range(quot;SortRangequot;).Sort Key1:=Range(quot;SortRangequot;), _
gt; Order1:=xlAscending
gt; Range(quot;sortrangequot;).End(xlDown).offset(1).Select
gt; End Sub
gt; --
gt; Don Guillett
gt; SalesAid Software
gt;
gt; quot;Terry Bennettquot; gt; wrote in message
gt; ...
gt;gt; Doesn't seem very keen on this. Am I adding on to the end of the
gt;gt; existing script?
gt;gt;
gt;gt; quot;Don Guillettquot; gt; wrote in message
gt;gt; ...
gt;gt;gt; try
gt;gt;gt; Sub sortsortrange()
gt;gt;gt; Range(quot;SortRangequot;).Sort Key1:=Range(quot;SortRangequot;), _
gt;gt;gt; Order1:=xlAscending
gt;gt;gt; End Sub
gt;gt;gt;
gt;gt;gt;
gt;gt;gt; --
gt;gt;gt; Don Guillett
gt;gt;gt; SalesAid Software
gt;gt;gt;
gt;gt;gt; quot;Terry Bennettquot; gt; wrote in message
gt;gt;gt; ...
gt;gt;gt;gt; I'm sure this is a very easy one but I'm not too well versed on Macros
gt;gt;gt;gt; / VBA.
gt;gt;gt;gt;
gt;gt;gt;gt; I have a worksheet with ever expanding data - rows at the bottom of the
gt;gt;gt;gt; data are continually added. I have a simple macro that sorts all of
gt;gt;gt;gt; the data according to preset parameters and selects the next blank cell
gt;gt;gt;gt; in column A, ready for more data:
gt;gt;gt;gt;
gt;gt;gt;gt; Sub Macro5()
gt;gt;gt;gt; Range(quot;SortRangequot;).Select
gt;gt;gt;gt; Selection.Sort Key1:=Range(quot;SortRangequot;), Order1:=xlAscending,
gt;gt;gt;gt; Header:= _
gt;gt;gt;gt; xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
gt;gt;gt;gt; xlTopToBottom
gt;gt;gt;gt; Do Until ActiveCell.Value = IsEmpty(True)
gt;gt;gt;gt; ActiveCell.Offset(1, 0).Activate
gt;gt;gt;gt; Loop
gt;gt;gt;gt; End Sub
gt;gt;gt;gt;
gt;gt;gt;gt; When running the Macro, this leaves all of the cells in the range
gt;gt;gt;gt; 'selected' (ie; coloured-over). What do I need to add to the Macro to
gt;gt;gt;gt; just select the cell in Column A and remove the highlighting from all
gt;gt;gt;gt; the other cells?
gt;gt;gt;gt;
gt;gt;gt;gt; Thanks.
gt;gt;gt;gt;
gt;gt;gt;
gt;gt;gt;
gt;gt;
gt;gt;
gt;
gt;
I'm suggesting using this INSTEAD of yours. Let me know if it works.--
Don Guillett
SalesAid Software

quot;Terry Bennettquot; gt; wrote in message
...
gt; Don - correct assumption re 'SortRange'.
gt;
gt; Sorry, but could you tell me exacty what amendments to make to the code I
gt; listed below? As mentioned, I am a novice at VBA and I don't understand
gt; what you're suggesting.
gt;
gt; Thanks.
gt;
gt; quot;Don Guillettquot; gt; wrote in message
gt; ...
gt;gt; did you try it?
gt;gt; I assume that quot;sortrangequot; is a defined name that will automatically
gt;gt; adjust with each entry
gt;gt; something like.
gt;gt; =offset($a$1,0,0,counta(a:a),5)
gt;gt;
gt;gt; Sub sortsortrange()'I added a line
gt;gt; Range(quot;SortRangequot;).Sort Key1:=Range(quot;SortRangequot;), _
gt;gt; Order1:=xlAscending
gt;gt; Range(quot;sortrangequot;).End(xlDown).offset(1).Select
gt;gt; End Sub
gt;gt; --
gt;gt; Don Guillett
gt;gt; SalesAid Software
gt;gt;
gt;gt; quot;Terry Bennettquot; gt; wrote in message
gt;gt; ...
gt;gt;gt; Doesn't seem very keen on this. Am I adding on to the end of the
gt;gt;gt; existing script?
gt;gt;gt;
gt;gt;gt; quot;Don Guillettquot; gt; wrote in message
gt;gt;gt; ...
gt;gt;gt;gt; try
gt;gt;gt;gt; Sub sortsortrange()
gt;gt;gt;gt; Range(quot;SortRangequot;).Sort Key1:=Range(quot;SortRangequot;), _
gt;gt;gt;gt; Order1:=xlAscending
gt;gt;gt;gt; End Sub
gt;gt;gt;gt;
gt;gt;gt;gt;
gt;gt;gt;gt; --
gt;gt;gt;gt; Don Guillett
gt;gt;gt;gt; SalesAid Software
gt;gt;gt;gt;
gt;gt;gt;gt; quot;Terry Bennettquot; gt; wrote in message
gt;gt;gt;gt; ...
gt;gt;gt;gt;gt; I'm sure this is a very easy one but I'm not too well versed on Macros
gt;gt;gt;gt;gt; / VBA.
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt; I have a worksheet with ever expanding data - rows at the bottom of
gt;gt;gt;gt;gt; the data are continually added. I have a simple macro that sorts all
gt;gt;gt;gt;gt; of the data according to preset parameters and selects the next blank
gt;gt;gt;gt;gt; cell in column A, ready for more data:
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt; Sub Macro5()
gt;gt;gt;gt;gt; Range(quot;SortRangequot;).Select
gt;gt;gt;gt;gt; Selection.Sort Key1:=Range(quot;SortRangequot;), Order1:=xlAscending,
gt;gt;gt;gt;gt; Header:= _
gt;gt;gt;gt;gt; xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
gt;gt;gt;gt;gt; xlTopToBottom
gt;gt;gt;gt;gt; Do Until ActiveCell.Value = IsEmpty(True)
gt;gt;gt;gt;gt; ActiveCell.Offset(1, 0).Activate
gt;gt;gt;gt;gt; Loop
gt;gt;gt;gt;gt; End Sub
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt; When running the Macro, this leaves all of the cells in the range
gt;gt;gt;gt;gt; 'selected' (ie; coloured-over). What do I need to add to the Macro to
gt;gt;gt;gt;gt; just select the cell in Column A and remove the highlighting from all
gt;gt;gt;gt;gt; the other cells?
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt; Thanks.
gt;gt;gt;gt;gt;
gt;gt;gt;gt;
gt;gt;gt;gt;
gt;gt;gt;
gt;gt;gt;
gt;gt;
gt;gt;
gt;
gt;
Don - almost. Only problem being that it sorts the row headers, currently
in row 3, as well! The existing Macro doesn't do that. Otherwise it seems
to be good!

quot;Don Guillettquot; gt; wrote in message
...
gt; I'm suggesting using this INSTEAD of yours. Let me know if it works.
gt;
gt;
gt; --
gt; Don Guillett
gt; SalesAid Software
gt;
gt; quot;Terry Bennettquot; gt; wrote in message
gt; ...
gt;gt; Don - correct assumption re 'SortRange'.
gt;gt;
gt;gt; Sorry, but could you tell me exacty what amendments to make to the code I
gt;gt; listed below? As mentioned, I am a novice at VBA and I don't understand
gt;gt; what you're suggesting.
gt;gt;
gt;gt; Thanks.
gt;gt;
gt;gt; quot;Don Guillettquot; gt; wrote in message
gt;gt; ...
gt;gt;gt; did you try it?
gt;gt;gt; I assume that quot;sortrangequot; is a defined name that will automatically
gt;gt;gt; adjust with each entry
gt;gt;gt; something like.
gt;gt;gt; =offset($a$1,0,0,counta(a:a),5)
gt;gt;gt;
gt;gt;gt; Sub sortsortrange()'I added a line
gt;gt;gt; Range(quot;SortRangequot;).Sort Key1:=Range(quot;SortRangequot;), _
gt;gt;gt; Order1:=xlAscending
gt;gt;gt; Range(quot;sortrangequot;).End(xlDown).offset(1).Select
gt;gt;gt; End Sub
gt;gt;gt; --
gt;gt;gt; Don Guillett
gt;gt;gt; SalesAid Software
gt;gt;gt;
gt;gt;gt; quot;Terry Bennettquot; gt; wrote in message
gt;gt;gt; ...
gt;gt;gt;gt; Doesn't seem very keen on this. Am I adding on to the end of the
gt;gt;gt;gt; existing script?
gt;gt;gt;gt;
gt;gt;gt;gt; quot;Don Guillettquot; gt; wrote in message
gt;gt;gt;gt; ...
gt;gt;gt;gt;gt; try
gt;gt;gt;gt;gt; Sub sortsortrange()
gt;gt;gt;gt;gt; Range(quot;SortRangequot;).Sort Key1:=Range(quot;SortRangequot;), _
gt;gt;gt;gt;gt; Order1:=xlAscending
gt;gt;gt;gt;gt; End Sub
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt; --
gt;gt;gt;gt;gt; Don Guillett
gt;gt;gt;gt;gt; SalesAid Software
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt; quot;Terry Bennettquot; gt; wrote in message
gt;gt;gt;gt;gt; ...
gt;gt;gt;gt;gt;gt; I'm sure this is a very easy one but I'm not too well versed on
gt;gt;gt;gt;gt;gt; Macros / VBA.
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt; I have a worksheet with ever expanding data - rows at the bottom of
gt;gt;gt;gt;gt;gt; the data are continually added. I have a simple macro that sorts all
gt;gt;gt;gt;gt;gt; of the data according to preset parameters and selects the next blank
gt;gt;gt;gt;gt;gt; cell in column A, ready for more data:
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt; Sub Macro5()
gt;gt;gt;gt;gt;gt; Range(quot;SortRangequot;).Select
gt;gt;gt;gt;gt;gt; Selection.Sort Key1:=Range(quot;SortRangequot;), Order1:=xlAscending,
gt;gt;gt;gt;gt;gt; Header:= _
gt;gt;gt;gt;gt;gt; xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
gt;gt;gt;gt;gt;gt; xlTopToBottom
gt;gt;gt;gt;gt;gt; Do Until ActiveCell.Value = IsEmpty(True)
gt;gt;gt;gt;gt;gt; ActiveCell.Offset(1, 0).Activate
gt;gt;gt;gt;gt;gt; Loop
gt;gt;gt;gt;gt;gt; End Sub
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt; When running the Macro, this leaves all of the cells in the range
gt;gt;gt;gt;gt;gt; 'selected' (ie; coloured-over). What do I need to add to the Macro
gt;gt;gt;gt;gt;gt; to just select the cell in Column A and remove the highlighting from
gt;gt;gt;gt;gt;gt; all the other cells?
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt; Thanks.
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;
gt;gt;gt;gt;
gt;gt;gt;gt;
gt;gt;gt;
gt;gt;gt;
gt;gt;
gt;gt;
gt;
gt;
try adding back the ,xlguess

--
Don Guillett
SalesAid Software

quot;Terry Bennettquot; gt; wrote in message
...
gt; Don - almost. Only problem being that it sorts the row headers, currently
gt; in row 3, as well! The existing Macro doesn't do that. Otherwise it
gt; seems to be good!
gt;
gt; quot;Don Guillettquot; gt; wrote in message
gt; ...
gt;gt; I'm suggesting using this INSTEAD of yours. Let me know if it works.
gt;gt;
gt;gt;
gt;gt; --
gt;gt; Don Guillett
gt;gt; SalesAid Software
gt;gt;
gt;gt; quot;Terry Bennettquot; gt; wrote in message
gt;gt; ...
gt;gt;gt; Don - correct assumption re 'SortRange'.
gt;gt;gt;
gt;gt;gt; Sorry, but could you tell me exacty what amendments to make to the code
gt;gt;gt; I listed below? As mentioned, I am a novice at VBA and I don't
gt;gt;gt; understand what you're suggesting.
gt;gt;gt;
gt;gt;gt; Thanks.
gt;gt;gt;
gt;gt;gt; quot;Don Guillettquot; gt; wrote in message
gt;gt;gt; ...
gt;gt;gt;gt; did you try it?
gt;gt;gt;gt; I assume that quot;sortrangequot; is a defined name that will automatically
gt;gt;gt;gt; adjust with each entry
gt;gt;gt;gt; something like.
gt;gt;gt;gt; =offset($a$1,0,0,counta(a:a),5)
gt;gt;gt;gt;
gt;gt;gt;gt; Sub sortsortrange()'I added a line
gt;gt;gt;gt; Range(quot;SortRangequot;).Sort Key1:=Range(quot;SortRangequot;), _
gt;gt;gt;gt; Order1:=xlAscending
gt;gt;gt;gt; Range(quot;sortrangequot;).End(xlDown).offset(1).Select
gt;gt;gt;gt; End Sub
gt;gt;gt;gt; --
gt;gt;gt;gt; Don Guillett
gt;gt;gt;gt; SalesAid Software
gt;gt;gt;gt;
gt;gt;gt;gt; quot;Terry Bennettquot; gt; wrote in message
gt;gt;gt;gt; ...
gt;gt;gt;gt;gt; Doesn't seem very keen on this. Am I adding on to the end of the
gt;gt;gt;gt;gt; existing script?
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt; quot;Don Guillettquot; gt; wrote in message
gt;gt;gt;gt;gt; ...
gt;gt;gt;gt;gt;gt; try
gt;gt;gt;gt;gt;gt; Sub sortsortrange()
gt;gt;gt;gt;gt;gt; Range(quot;SortRangequot;).Sort Key1:=Range(quot;SortRangequot;), _
gt;gt;gt;gt;gt;gt; Order1:=xlAscending
gt;gt;gt;gt;gt;gt; End Sub
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt; --
gt;gt;gt;gt;gt;gt; Don Guillett
gt;gt;gt;gt;gt;gt; SalesAid Software
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt; quot;Terry Bennettquot; gt; wrote in message
gt;gt;gt;gt;gt;gt; ...
gt;gt;gt;gt;gt;gt;gt; I'm sure this is a very easy one but I'm not too well versed on
gt;gt;gt;gt;gt;gt;gt; Macros / VBA.
gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt; I have a worksheet with ever expanding data - rows at the bottom of
gt;gt;gt;gt;gt;gt;gt; the data are continually added. I have a simple macro that sorts
gt;gt;gt;gt;gt;gt;gt; all of the data according to preset parameters and selects the next
gt;gt;gt;gt;gt;gt;gt; blank cell in column A, ready for more data:
gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt; Sub Macro5()
gt;gt;gt;gt;gt;gt;gt; Range(quot;SortRangequot;).Select
gt;gt;gt;gt;gt;gt;gt; Selection.Sort Key1:=Range(quot;SortRangequot;), Order1:=xlAscending,
gt;gt;gt;gt;gt;gt;gt; Header:= _
gt;gt;gt;gt;gt;gt;gt; xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
gt;gt;gt;gt;gt;gt;gt; xlTopToBottom
gt;gt;gt;gt;gt;gt;gt; Do Until ActiveCell.Value = IsEmpty(True)
gt;gt;gt;gt;gt;gt;gt; ActiveCell.Offset(1, 0).Activate
gt;gt;gt;gt;gt;gt;gt; Loop
gt;gt;gt;gt;gt;gt;gt; End Sub
gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt; When running the Macro, this leaves all of the cells in the range
gt;gt;gt;gt;gt;gt;gt; 'selected' (ie; coloured-over). What do I need to add to the Macro
gt;gt;gt;gt;gt;gt;gt; to just select the cell in Column A and remove the highlighting from
gt;gt;gt;gt;gt;gt;gt; all the other cells?
gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt; Thanks.
gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;
gt;gt;gt;gt;
gt;gt;gt;gt;
gt;gt;gt;
gt;gt;gt;
gt;gt;
gt;gt;
gt;
gt;
Don - my mistake - the range was wrongly defined.

All seems to work very well. Thanks for your help!

Terry

quot;Don Guillettquot; gt; wrote in message
...
gt; try adding back the ,xlguess
gt;
gt; --
gt; Don Guillett
gt; SalesAid Software
gt;
gt; quot;Terry Bennettquot; gt; wrote in message
gt; ...
gt;gt; Don - almost. Only problem being that it sorts the row headers,
gt;gt; currently in row 3, as well! The existing Macro doesn't do that.
gt;gt; Otherwise it seems to be good!
gt;gt;
gt;gt; quot;Don Guillettquot; gt; wrote in message
gt;gt; ...
gt;gt;gt; I'm suggesting using this INSTEAD of yours. Let me know if it works.
gt;gt;gt;
gt;gt;gt;
gt;gt;gt; --
gt;gt;gt; Don Guillett
gt;gt;gt; SalesAid Software
gt;gt;gt;
gt;gt;gt; quot;Terry Bennettquot; gt; wrote in message
gt;gt;gt; ...
gt;gt;gt;gt; Don - correct assumption re 'SortRange'.
gt;gt;gt;gt;
gt;gt;gt;gt; Sorry, but could you tell me exacty what amendments to make to the code
gt;gt;gt;gt; I listed below? As mentioned, I am a novice at VBA and I don't
gt;gt;gt;gt; understand what you're suggesting.
gt;gt;gt;gt;
gt;gt;gt;gt; Thanks.
gt;gt;gt;gt;
gt;gt;gt;gt; quot;Don Guillettquot; gt; wrote in message
gt;gt;gt;gt; ...
gt;gt;gt;gt;gt; did you try it?
gt;gt;gt;gt;gt; I assume that quot;sortrangequot; is a defined name that will automatically
gt;gt;gt;gt;gt; adjust with each entry
gt;gt;gt;gt;gt; something like.
gt;gt;gt;gt;gt; =offset($a$1,0,0,counta(a:a),5)
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt; Sub sortsortrange()'I added a line
gt;gt;gt;gt;gt; Range(quot;SortRangequot;).Sort Key1:=Range(quot;SortRangequot;), _
gt;gt;gt;gt;gt; Order1:=xlAscending
gt;gt;gt;gt;gt; Range(quot;sortrangequot;).End(xlDown).offset(1).Select
gt;gt;gt;gt;gt; End Sub
gt;gt;gt;gt;gt; --
gt;gt;gt;gt;gt; Don Guillett
gt;gt;gt;gt;gt; SalesAid Software
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt; quot;Terry Bennettquot; gt; wrote in message
gt;gt;gt;gt;gt; ...
gt;gt;gt;gt;gt;gt; Doesn't seem very keen on this. Am I adding on to the end of the
gt;gt;gt;gt;gt;gt; existing script?
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt; quot;Don Guillettquot; gt; wrote in message
gt;gt;gt;gt;gt;gt; ...
gt;gt;gt;gt;gt;gt;gt; try
gt;gt;gt;gt;gt;gt;gt; Sub sortsortrange()
gt;gt;gt;gt;gt;gt;gt; Range(quot;SortRangequot;).Sort Key1:=Range(quot;SortRangequot;), _
gt;gt;gt;gt;gt;gt;gt; Order1:=xlAscending
gt;gt;gt;gt;gt;gt;gt; End Sub
gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt; --
gt;gt;gt;gt;gt;gt;gt; Don Guillett
gt;gt;gt;gt;gt;gt;gt; SalesAid Software
gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt; quot;Terry Bennettquot; gt; wrote in message
gt;gt;gt;gt;gt;gt;gt; ...
gt;gt;gt;gt;gt;gt;gt;gt; I'm sure this is a very easy one but I'm not too well versed on
gt;gt;gt;gt;gt;gt;gt;gt; Macros / VBA.
gt;gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;gt; I have a worksheet with ever expanding data - rows at the bottom of
gt;gt;gt;gt;gt;gt;gt;gt; the data are continually added. I have a simple macro that sorts
gt;gt;gt;gt;gt;gt;gt;gt; all of the data according to preset parameters and selects the next
gt;gt;gt;gt;gt;gt;gt;gt; blank cell in column A, ready for more data:
gt;gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;gt; Sub Macro5()
gt;gt;gt;gt;gt;gt;gt;gt; Range(quot;SortRangequot;).Select
gt;gt;gt;gt;gt;gt;gt;gt; Selection.Sort Key1:=Range(quot;SortRangequot;), Order1:=xlAscending,
gt;gt;gt;gt;gt;gt;gt;gt; Header:= _
gt;gt;gt;gt;gt;gt;gt;gt; xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
gt;gt;gt;gt;gt;gt;gt;gt; xlTopToBottom
gt;gt;gt;gt;gt;gt;gt;gt; Do Until ActiveCell.Value = IsEmpty(True)
gt;gt;gt;gt;gt;gt;gt;gt; ActiveCell.Offset(1, 0).Activate
gt;gt;gt;gt;gt;gt;gt;gt; Loop
gt;gt;gt;gt;gt;gt;gt;gt; End Sub
gt;gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;gt; When running the Macro, this leaves all of the cells in the range
gt;gt;gt;gt;gt;gt;gt;gt; 'selected' (ie; coloured-over). What do I need to add to the Macro
gt;gt;gt;gt;gt;gt;gt;gt; to just select the cell in Column A and remove the highlighting
gt;gt;gt;gt;gt;gt;gt;gt; from all the other cells?
gt;gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;gt; Thanks.
gt;gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;
gt;gt;gt;gt;
gt;gt;gt;gt;
gt;gt;gt;
gt;gt;gt;
gt;gt;
gt;gt;
gt;
gt;
glad to help

--
Don Guillett
SalesAid Software

quot;Terry Bennettquot; gt; wrote in message
...
gt; Don - my mistake - the range was wrongly defined.
gt;
gt; All seems to work very well. Thanks for your help!
gt;
gt; Terry
gt;
gt; quot;Don Guillettquot; gt; wrote in message
gt; ...
gt;gt; try adding back the ,xlguess
gt;gt;
gt;gt; --
gt;gt; Don Guillett
gt;gt; SalesAid Software
gt;gt;
gt;gt; quot;Terry Bennettquot; gt; wrote in message
gt;gt; ...
gt;gt;gt; Don - almost. Only problem being that it sorts the row headers,
gt;gt;gt; currently in row 3, as well! The existing Macro doesn't do that.
gt;gt;gt; Otherwise it seems to be good!
gt;gt;gt;
gt;gt;gt; quot;Don Guillettquot; gt; wrote in message
gt;gt;gt; ...
gt;gt;gt;gt; I'm suggesting using this INSTEAD of yours. Let me know if it works.
gt;gt;gt;gt;
gt;gt;gt;gt;
gt;gt;gt;gt; --
gt;gt;gt;gt; Don Guillett
gt;gt;gt;gt; SalesAid Software
gt;gt;gt;gt;
gt;gt;gt;gt; quot;Terry Bennettquot; gt; wrote in message
gt;gt;gt;gt; ...
gt;gt;gt;gt;gt; Don - correct assumption re 'SortRange'.
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt; Sorry, but could you tell me exacty what amendments to make to the
gt;gt;gt;gt;gt; code I listed below? As mentioned, I am a novice at VBA and I don't
gt;gt;gt;gt;gt; understand what you're suggesting.
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt; Thanks.
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt; quot;Don Guillettquot; gt; wrote in message
gt;gt;gt;gt;gt; ...
gt;gt;gt;gt;gt;gt; did you try it?
gt;gt;gt;gt;gt;gt; I assume that quot;sortrangequot; is a defined name that will automatically
gt;gt;gt;gt;gt;gt; adjust with each entry
gt;gt;gt;gt;gt;gt; something like.
gt;gt;gt;gt;gt;gt; =offset($a$1,0,0,counta(a:a),5)
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt; Sub sortsortrange()'I added a line
gt;gt;gt;gt;gt;gt; Range(quot;SortRangequot;).Sort Key1:=Range(quot;SortRangequot;), _
gt;gt;gt;gt;gt;gt; Order1:=xlAscending
gt;gt;gt;gt;gt;gt; Range(quot;sortrangequot;).End(xlDown).offset(1).Select
gt;gt;gt;gt;gt;gt; End Sub
gt;gt;gt;gt;gt;gt; --
gt;gt;gt;gt;gt;gt; Don Guillett
gt;gt;gt;gt;gt;gt; SalesAid Software
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt; quot;Terry Bennettquot; gt; wrote in message
gt;gt;gt;gt;gt;gt; ...
gt;gt;gt;gt;gt;gt;gt; Doesn't seem very keen on this. Am I adding on to the end of the
gt;gt;gt;gt;gt;gt;gt; existing script?
gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt; quot;Don Guillettquot; gt; wrote in message
gt;gt;gt;gt;gt;gt;gt; ...
gt;gt;gt;gt;gt;gt;gt;gt; try
gt;gt;gt;gt;gt;gt;gt;gt; Sub sortsortrange()
gt;gt;gt;gt;gt;gt;gt;gt; Range(quot;SortRangequot;).Sort Key1:=Range(quot;SortRangequot;), _
gt;gt;gt;gt;gt;gt;gt;gt; Order1:=xlAscending
gt;gt;gt;gt;gt;gt;gt;gt; End Sub
gt;gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;gt; --
gt;gt;gt;gt;gt;gt;gt;gt; Don Guillett
gt;gt;gt;gt;gt;gt;gt;gt; SalesAid Software
gt;gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;gt; quot;Terry Bennettquot; gt; wrote in message
gt;gt;gt;gt;gt;gt;gt;gt; ...
gt;gt;gt;gt;gt;gt;gt;gt;gt; I'm sure this is a very easy one but I'm not too well versed on
gt;gt;gt;gt;gt;gt;gt;gt;gt; Macros / VBA.
gt;gt;gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;gt;gt; I have a worksheet with ever expanding data - rows at the bottom
gt;gt;gt;gt;gt;gt;gt;gt;gt; of the data are continually added. I have a simple macro that
gt;gt;gt;gt;gt;gt;gt;gt;gt; sorts all of the data according to preset parameters and selects
gt;gt;gt;gt;gt;gt;gt;gt;gt; the next blank cell in column A, ready for more data:
gt;gt;gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;gt;gt; Sub Macro5()
gt;gt;gt;gt;gt;gt;gt;gt;gt; Range(quot;SortRangequot;).Select
gt;gt;gt;gt;gt;gt;gt;gt;gt; Selection.Sort Key1:=Range(quot;SortRangequot;), Order1:=xlAscending,
gt;gt;gt;gt;gt;gt;gt;gt;gt; Header:= _
gt;gt;gt;gt;gt;gt;gt;gt;gt; xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
gt;gt;gt;gt;gt;gt;gt;gt;gt; xlTopToBottom
gt;gt;gt;gt;gt;gt;gt;gt;gt; Do Until ActiveCell.Value = IsEmpty(True)
gt;gt;gt;gt;gt;gt;gt;gt;gt; ActiveCell.Offset(1, 0).Activate
gt;gt;gt;gt;gt;gt;gt;gt;gt; Loop
gt;gt;gt;gt;gt;gt;gt;gt;gt; End Sub
gt;gt;gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;gt;gt; When running the Macro, this leaves all of the cells in the range
gt;gt;gt;gt;gt;gt;gt;gt;gt; 'selected' (ie; coloured-over). What do I need to add to the
gt;gt;gt;gt;gt;gt;gt;gt;gt; Macro to just select the cell in Column A and remove the
gt;gt;gt;gt;gt;gt;gt;gt;gt; highlighting from all the other cells?
gt;gt;gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;gt;gt; Thanks.
gt;gt;gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;
gt;gt;gt;gt;gt;
gt;gt;gt;gt;
gt;gt;gt;gt;
gt;gt;gt;
gt;gt;gt;
gt;gt;
gt;gt;
gt;
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()