Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default seting a changing range to sort on 3 different sheets

I have been working on this for a while with no luck. I have a list in 3
different sheets for different departments. I am using a userform to enter
the new data and i need some way to set the new range to sort when new data
is added. i need to sort using column b and d.

for example
a b c d e f
1 Charlie 7-27-07 sick
2 Zach 8-21-07 late
3 charlie 1-30-07 off
4 Steve 9-02-07 late


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default seting a changing range to sort on 3 different sheets

If your userform is adding the new data in the first available row beneath
the existing data could you just add the following at the end of the code you
are using to add the data to each worksheet?

Range("A2").Select
Selection.CurrentRegion.Select
Selection.Sort Key1:=Range("B2"), Key2:=Range("D2")

?? does this help?

"jhyatt" wrote:

I have been working on this for a while with no luck. I have a list in 3
different sheets for different departments. I am using a userform to enter
the new data and i need some way to set the new range to sort when new data
is added. i need to sort using column b and d.

for example
a b c d e f
1 Charlie 7-27-07 sick
2 Zach 8-21-07 late
3 charlie 1-30-07 off
4 Steve 9-02-07 late


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default seting a changing range to sort on 3 different sheets

the code you gave does not sort to the existing list this is what i have but
when a different department (that goes on a different sheet) is selected it
does not work.

if you want to look at the entire code i can post.

Dim NumCount As Long
NumCount = Cells(Rows.Count, "b").End(xlUp).Row
Range("b5:f" & NumCount).sort Key1:=Range("b5"), key2:=Range("d5")

"pablo bellissimo" wrote:

If your userform is adding the new data in the first available row beneath
the existing data could you just add the following at the end of the code you
are using to add the data to each worksheet?

Range("A2").Select
Selection.CurrentRegion.Select
Selection.Sort Key1:=Range("B2"), Key2:=Range("D2")

?? does this help?

"jhyatt" wrote:

I have been working on this for a while with no luck. I have a list in 3
different sheets for different departments. I am using a userform to enter
the new data and i need some way to set the new range to sort when new data
is added. i need to sort using column b and d.

for example
a b c d e f
1 Charlie 7-27-07 sick
2 Zach 8-21-07 late
3 charlie 1-30-07 off
4 Steve 9-02-07 late


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
Sort a changing range jhyatt Excel Discussion (Misc queries) 0 September 18th 07 08:04 PM
Consolidate data on different sheets in a changing range Ciara Excel Programming 0 September 12th 06 02:21 PM
Changing the range of a table sort RedHook New Users to Excel 2 May 31st 06 08:38 AM
Changing one range on multiple sheets. Mike-hime Excel Programming 3 January 6th 04 10:09 PM
Changing the value in multiple sheets without selecting those sheets herm Excel Programming 3 October 14th 03 03:50 PM


All times are GMT +1. The time now is 08:44 PM.

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

About Us

"It's about Microsoft Excel"