BigBas,
I could not get your change in code to work. So I recorded a macro sorting the data manually.
The only thing I chanded was the range. (since there will be addition later)
Here is what I now have:
Sub SortData()
Application.ScreenUpdating = False
'Sort MFR Data
ActiveWorkbook.Worksheets("MFR_List").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("MFR_List").Sort.SortFields.Add Key:=Range( _
"B2:B65000"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("MFR_List").Sort.SortFields.Add Key:=Range( _
"E2:E65000"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("MFR_List").Sort.SortFields.Add Key:=Range( _
"A2:A65000"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("MFR_List").Sort
.SetRange Range("A1:F65000")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Application.ScreenUpdating = True
End Sub

Originally Posted by
jaslake
Hi Cory
I'm going to step back...it appears you're in good hands with BigBas. If you need further help, PM me.
John,
I would prefer getting as many eyes on this as possible. Seems like I still have a lot of work ahead of me.
I am working on this for my job, so I am kind of under the gun here to get it done quickly and correctly.
As for this:

Originally Posted by
jaslake
Hi Cory
Regarding the "next step".
- As I understand it, the UserForm will be in a workbook by itself (let's call it Macro_Book.xls) with no data (no MFR_List worksheet, no Selection_List worksheet and no Sheet2)
- As I understand it, these worksheets (MFR_List worksheet, Selection_List worksheet and Sheet2) will be in another workbook (let's call it Data.xls).
- If my understanding is correct, what needs to happen now.
- If my undersatnding is NOT correct (which I suspect), fix it (my understanding).
You are correct, and not correct at the same time. I have one of two scenarios to play with.
Scenario one: (My preference) I have a semi-blank workbook ( call it "Template.xls" ) that when opened will also open the workbook "Data.xls" IN THE BACKGROUND that contains the UserForm, MFR_List worksheet, Selection_List. I will add a control button and/or shortcut keys to "Template.xls" that call out to open the UserForm in "Data.xls" This "Data.xls" will be stored on a network drive where several people have access and may be using it at the same time. I would also like to keep it Read Only to keep people from modifying the data within the workbook, but I am unsure if that is possible when it is opened as Read Only. (Maybe coding in my userform can take the read only off, then re-apply it?)
Scenario two: (seams easiest) I have the "Template.xls" workbook that DOES contain the Userform code, but we will still be opening the "Data.xls" in the background to read/write data. So the code will still have to point to "Data.xls"
The "Data.xls" workbook MUST be separate of the "Template.xls" because the data within it is ~40,000 lines long. We obviously don't want to have hundreds of copies of that sitting on a server.
Purpose: People who are using "Template.xls" are filling in data with the MFR code. We will use vlookup to fill in most of those from "Data.xls", but not all of them exist, or some of them need to be changed. Que the the UserForm. With that they can add/modify that list on the fly so that once added, that vlookup will see that data. We will be automating something that someone has to do manually without any userform. Also, people have started there own lists of MFR Code, so we want to combine it and become uniform on what everyone is using.
I am fairly sure that the first scenario is very possible. It is just a matter of changing some of the code to call out explicit workbook/worksheet name.
I am not sure, but something like this:
Dim wb As Workbook
Set wb = "MFR Userform Test Book v.X.xls"
Dim ws As Worksheet
Set ws = "MFR_List"
However I know very little about the 'me' statements, nor if the 'sheet' statements would need changing, so I don't know how those would be affected.
I hope this gives you a little better understanding about where I am going with this.
Feel free to pm with questions if you do not want to clutter the forum.
Thank you again for all your time and effort everyone!
Cory
Bookmarks