#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Terry Bennett
 
Posts: n/a
Default Macro question

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("SortRange").Select
Selection.Sort Key1:=Range("SortRange"), 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.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett
 
Posts: n/a
Default Macro question

did you try it?
I assume that "sortrange" 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("SortRange").Sort Key1:=Range("SortRange"), _
Order1:=xlAscending
Range("sortrange").End(xlDown).offset(1).Select
End Sub
--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
Doesn't seem very keen on this. Am I adding on to the end of the existing
script?

"Don Guillett" wrote in message
...
try
Sub sortsortrange()
Range("SortRange").Sort Key1:=Range("SortRange"), _
Order1:=xlAscending
End Sub


--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
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("SortRange").Select
Selection.Sort Key1:=Range("SortRange"), 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.







  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Terry Bennett
 
Posts: n/a
Default Macro question

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.

"Don Guillett" wrote in message
...
did you try it?
I assume that "sortrange" 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("SortRange").Sort Key1:=Range("SortRange"), _
Order1:=xlAscending
Range("sortrange").End(xlDown).offset(1).Select
End Sub
--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
Doesn't seem very keen on this. Am I adding on to the end of the
existing script?

"Don Guillett" wrote in message
...
try
Sub sortsortrange()
Range("SortRange").Sort Key1:=Range("SortRange"), _
Order1:=xlAscending
End Sub


--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
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("SortRange").Select
Selection.Sort Key1:=Range("SortRange"), 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.











  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett
 
Posts: n/a
Default Macro question

I'm suggesting using this INSTEAD of yours. Let me know if it works.


--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
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.

"Don Guillett" wrote in message
...
did you try it?
I assume that "sortrange" 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("SortRange").Sort Key1:=Range("SortRange"), _
Order1:=xlAscending
Range("sortrange").End(xlDown).offset(1).Select
End Sub
--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
Doesn't seem very keen on this. Am I adding on to the end of the
existing script?

"Don Guillett" wrote in message
...
try
Sub sortsortrange()
Range("SortRange").Sort Key1:=Range("SortRange"), _
Order1:=xlAscending
End Sub


--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
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("SortRange").Select
Selection.Sort Key1:=Range("SortRange"), 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.











  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Terry Bennett
 
Posts: n/a
Default Macro question

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!

"Don Guillett" wrote in message
...
I'm suggesting using this INSTEAD of yours. Let me know if it works.


--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
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.

"Don Guillett" wrote in message
...
did you try it?
I assume that "sortrange" 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("SortRange").Sort Key1:=Range("SortRange"), _
Order1:=xlAscending
Range("sortrange").End(xlDown).offset(1).Select
End Sub
--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
Doesn't seem very keen on this. Am I adding on to the end of the
existing script?

"Don Guillett" wrote in message
...
try
Sub sortsortrange()
Range("SortRange").Sort Key1:=Range("SortRange"), _
Order1:=xlAscending
End Sub


--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
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("SortRange").Select
Selection.Sort Key1:=Range("SortRange"), 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.













  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett
 
Posts: n/a
Default Macro question

try adding back the ,xlguess

--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
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!

"Don Guillett" wrote in message
...
I'm suggesting using this INSTEAD of yours. Let me know if it works.


--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
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.

"Don Guillett" wrote in message
...
did you try it?
I assume that "sortrange" 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("SortRange").Sort Key1:=Range("SortRange"), _
Order1:=xlAscending
Range("sortrange").End(xlDown).offset(1).Select
End Sub
--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
Doesn't seem very keen on this. Am I adding on to the end of the
existing script?

"Don Guillett" wrote in message
...
try
Sub sortsortrange()
Range("SortRange").Sort Key1:=Range("SortRange"), _
Order1:=xlAscending
End Sub


--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
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("SortRange").Select
Selection.Sort Key1:=Range("SortRange"), 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.















  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Terry Bennett
 
Posts: n/a
Default Macro question

Don - my mistake - the range was wrongly defined.

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

Terry

"Don Guillett" wrote in message
...
try adding back the ,xlguess

--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
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!

"Don Guillett" wrote in message
...
I'm suggesting using this INSTEAD of yours. Let me know if it works.


--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
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.

"Don Guillett" wrote in message
...
did you try it?
I assume that "sortrange" 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("SortRange").Sort Key1:=Range("SortRange"), _
Order1:=xlAscending
Range("sortrange").End(xlDown).offset(1).Select
End Sub
--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
Doesn't seem very keen on this. Am I adding on to the end of the
existing script?

"Don Guillett" wrote in message
...
try
Sub sortsortrange()
Range("SortRange").Sort Key1:=Range("SortRange"), _
Order1:=xlAscending
End Sub


--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
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("SortRange").Select
Selection.Sort Key1:=Range("SortRange"), 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.

















  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett
 
Posts: n/a
Default Macro question

glad to help

--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
Don - my mistake - the range was wrongly defined.

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

Terry

"Don Guillett" wrote in message
...
try adding back the ,xlguess

--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
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!

"Don Guillett" wrote in message
...
I'm suggesting using this INSTEAD of yours. Let me know if it works.


--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
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.

"Don Guillett" wrote in message
...
did you try it?
I assume that "sortrange" 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("SortRange").Sort Key1:=Range("SortRange"), _
Order1:=xlAscending
Range("sortrange").End(xlDown).offset(1).Select
End Sub
--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
Doesn't seem very keen on this. Am I adding on to the end of the
existing script?

"Don Guillett" wrote in message
...
try
Sub sortsortrange()
Range("SortRange").Sort Key1:=Range("SortRange"), _
Order1:=xlAscending
End Sub


--
Don Guillett
SalesAid Software

"Terry Bennett" wrote in message
...
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("SortRange").Select
Selection.Sort Key1:=Range("SortRange"), 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.



















Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Macro Question billrl34 Excel Worksheet Functions 1 December 19th 05 10:38 PM
using a macro question revisited Adam Kroger Excel Discussion (Misc queries) 4 December 16th 05 03:37 PM
Macro Question Chris Excel Worksheet Functions 0 July 18th 05 04:02 PM
Excel Macro Question about Conditional Formatting David Britton via OfficeKB.com New Users to Excel 3 February 10th 05 02:23 PM
Attn: Dave P. Question re Pix Calls via Macro DocuMike Excel Discussion (Misc queries) 1 January 10th 05 01:38 AM


All times are GMT +1. The time now is 11:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"