stirlingmw
Board Regular
- Joined
- Feb 18, 2013
- Messages
- 75
I have a workbook with the first spreadsheet being a "Nominal" of all my employees. This contains, Name, Initial and Age (Columns A to C)
my next 12 sheets equate to a month of the year Jan to Dec. The first 3 Columns in these sheets refer to the first 3 Columns in the "Nominal" sheet, returning the employees info.
The rest of the Columns in the month sheets (F to AJ) contains other info about the employee.
When I add a new employee to the bottom of the list I would then like the list to be sorted Ascending Alphabetically. This I have done with a CommandButton and macro
Sub SortName()
'
' SortName Macro
'
'
Range("A3:C300").Select
Selection.Sort Key1:=Range("A3"), Order1:=xlAscending, Key2:=Range("A3") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
Range("A3").Select
End Sub
This sorts the "Nominal" and also the other 12 sheets alphabetically, however in these other 12 sheets which contains more data about the employee for that month this Data remains in its original row and does not change with the employee, so now I have the correct Name, Initial and age of the employee, but the data in the data in Columns F to AJ could belong to someone else.
Please help, this is driving me mad.
Stirling
my next 12 sheets equate to a month of the year Jan to Dec. The first 3 Columns in these sheets refer to the first 3 Columns in the "Nominal" sheet, returning the employees info.
The rest of the Columns in the month sheets (F to AJ) contains other info about the employee.
When I add a new employee to the bottom of the list I would then like the list to be sorted Ascending Alphabetically. This I have done with a CommandButton and macro
Sub SortName()
'
' SortName Macro
'
'
Range("A3:C300").Select
Selection.Sort Key1:=Range("A3"), Order1:=xlAscending, Key2:=Range("A3") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
Range("A3").Select
End Sub
This sorts the "Nominal" and also the other 12 sheets alphabetically, however in these other 12 sheets which contains more data about the employee for that month this Data remains in its original row and does not change with the employee, so now I have the correct Name, Initial and age of the employee, but the data in the data in Columns F to AJ could belong to someone else.
Please help, this is driving me mad.
Stirling