View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default add a button on a spreadsheet that runs a macro

Sure

Record a macro when you do it manual and you can enter the macro name in the button click event

You can use something like this with headers in row 1 and your data start in A2
This sort on column A

Range("A1").CurrentRegion.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:= _
xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Easygoin123" wrote in message ...
I have set up a payroll spread sheet in the PC's we have in our stores in 9
states. Payroll is requesting the sheet be sorted alphabetically before
being faxed or emailed to them. I set up a control S to sort but wondered if
an activeX button in the spread sheet would work [left click with a mouse]
since the majority of the managers in the stores are not into computers. If
it would work How would I set it up and lock it so they could not mess it up?