Need help to copy a list from a worksheet to another and then put it in alhpabetical order

ginkas

New Member
Joined
Apr 29, 2014
Messages
47
Hello.

I will try to explain my problem and I wish someone can help me:

have a list on a worksheet. this list is not in alphabetical order
Right now, when I add a new name at the end of the list, I copy this list and paste it on another file that I need the same list. The dfference though, is that on this other file, I need this list to be in alphabetical order. Until now, when I paste the list, then I go manually and sort it alphabetically. It is not difficult. My problem is, that this file wll be used by people that have no idea of Excel, hence t is most probable that they will not be able to sort it alphabetically without losing data and creating chaos. Therefore, ideally, I would like to lock this fle and everything to be done automatically.

I really hope someone can help me. I don't know how to do it at all.

thank you very much
\gina
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Sub Macro2()
'
' Macro2 Macro
'


'
Range("Type here the range of data").Select
Selection.Copy
Sheets("New sheet where data needs to be copied").Select
Range("E4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.Worksheets("New sheet where data needs to be copied").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("New sheet where data needs to be copied").Sort.SortFields.Add Key:=Range("E4"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("New sheet where data needs to be copied").Sort
.SetRange Range("Type here the range of data")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,516
Messages
6,119,979
Members
448,934
Latest member
audette89

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top