Hi everyone, back again, you guys helped me a lot yesterday.
My problem this time is in regards to auto sorting a table as data is changed in another worksheet and is auto copied within the said table.
I.E. I need the Fax page (second last), the table has to auto sort based on column " C ". This is easily done using custom sort but can it be done automatically ? I want to lock the page so nobody modifies it.
I attached a copy of my work so far, using Excel 2007.
All the sheets are locked except " Player DATA " and " Fax ".
The password is " Moose ".
Here is what I found . . .
here is another post in this forum that is exactly what I need but cannot get it to work.
http://www.excelforum.com/excel-2007...o-sorting.html
and here is a copy of the code I recorded using macro recorder ( Please be patient as I'm driving blind here )
so to recapitulate, I need the Fax page to update (auto sort) when the data is changed in the " Player DATA " worksheet.Code:Sub AutoSort() ' ' AutoSort Macro ' ' ActiveWindow.SmallScroll Down:=-12 Range("A5:C29").Select ActiveWorkbook.Worksheets("Fax").Sort.SortFields.Clear ActiveWorkbook.Worksheets("Fax").Sort.SortFields.Add Key:=Range("C5:C29"), _ SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal With ActiveWorkbook.Worksheets("Fax").Sort .SetRange Range("A5:C29") .Header = xlGuess .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With End Sub
Last edited by Diesel13; 01-21-2010 at 12:43 PM. Reason: Problem is solved
does it have to be done using macros ?
Yes, macros would be simplest. I'll offer that.
1) Right-click on the FAX tab and select VIEW CODE
2) Paste in this sheet activation macro:
3) Close the editorCode:Option Explicit Private Sub Worksheet_Activate() Sheets("Player DATA").Range("B3:B27").Copy Range("B5").PasteSpecial xlPasteValues Sheets("Player DATA").Range("AL3:AL27").Copy Range("C5").PasteSpecial xlPasteValues Range("A5:C29").Sort Key1:=Range("A5"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End Sub
4) Save your sheet as a macro-enabled workbook (*.xlsm)
5) Now each time you bring up the FAX sheet onscreen it will reassert the list in ascending order.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
Wow, that was amazing, that is exactly what I wanted !
now . . . how do I make it work when the page is protected ?
I assume a macro that would unprotect, make the changes then reset the protection ?
Working on it . . .
if you know it, I would appreciate.
Thanks again, 20 hours of work on this and you just popped it out !
regards, Mike.
When you want to let macros free to do what they want on protected sheets, give them global permission one-time when you first open the workbook, then you don't have to make every macro deal with it.
Put this in the ThisWorkbook module, it will make the Player DATA sheet protected from users, but not from macros.
Of course, set your own password...Code:Private Sub Workbook_Open() Sheets("Player Data").Protect "Password", UserInterfaceOnly:=True End Sub
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
Thanks a lot, was almost perfect, here is what I put in . . .
and it works flawlessly !Code:Private Sub Workbook_Open() Sheets("Fax").Protect "Moose", UserInterfaceOnly:=True End Sub
Thanks a million
here is a copy of my finished work so it may help others who may have similar needs . . .
I would personally like to thank Daddylonglegs and JBeaucaire for the great help.
Everyone is authorized to download, use and modify this for their own purpose, I would only ask that you do it for free if you get it for someone else.
So to recapitulate, this is a Pool ( Billiard ) league spreadsheet. It is made for expandability in mind. All the DATA is entered in the " Player DATA " sheet. The info to all the pages is linked from there. All the calculations are made in the " Calculations " sheet and there is a fax sheet that is made to be printed on a regular sheet of paper for faxing. There are headers and there is a background image on all the player's sheets (inserted as a header) so it prints. ( Hit Print Preview to see it).
it is made so every player has an individualized sheet printed on one side and " Player DATA " printed on the other side using standard legal paper ( 8 1/2" x 14" ).
It is made with Excel 2007 Macro's enabled so if it don't work for you, enable Macros ?
Thanks again everyone this has been a fantastic adventure as a few days ago I did not have a clue how to do this but through patience, trial and error, a whole lot of reading and some help from the above mentioned, here is the fruit of my labor.
BTW, it's in French so you may need to translate some but heh, cannot be perfect in every ways !
Thanks again,
Mike.
If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].
(Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated. It is found across from the "time" in each of our posts.)
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
Sure thing and as for the Reputation Feedback, don't worry my friend, it's already done.
Mike.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks