Hi Everyone!
I'm in trouble again and it's driving me potty!
I have a code driven by a button that copies and pastes data from column B in worksheet "Team List" into column A in worksheet "Trouble Shooter" and then copies data from column B in worksheet "Division Splits" and pastes it in column B in worksheet "Trouble Shooter". The worksheet "Trouble Shooter" then compares the data in the two columns to ensure they match.
While the data in each is the same, the order it's in differs, so I'm attempting to sort each column into alphabetical order after it's pasted into the "Trouble Shooter" worksheet. I only want each column sorted, not the whole worksheet.
However, it doesn't seem to matter what I do, the columns don't sort alphabetically, or sort at all some times. The code doesn't throw up any errors and once it's run I can sort the columns using Data / Sort without a problem. The columns have headers which are static on the main worksheet.
Here's the bit of the code I have that fails.
'Sort Div input
Sheets("Team List").Range("B2:B100").Copy
Sheets("Trouble Shooter").Range("A2:A100").PasteSpecial xlPasteValues
Sheets("Division Splits").Range("B2:B100").Copy
Sheets("Trouble Shooter").Range("B2:B100").PasteSpecial xlPasteValues
Range("A:A").Sort Key1:=Range("A2"), _
Order1:=xlAscending, Header:=xlYes
Range("B:B").Sort Key1:=Range("B2"), _
Order1:=xlAscending, Header:=xlYes
Thanks in advance
Frankie
Bookmarks