View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default I need a Macro for Sorting workshhets

Try this

Private Sub Workbook_BeforeClose(Cancel As Boolean)
With ThisWorkbook
.Worksheets("Sheet1").Move Befo=.Worksheets(1)
.Save
End With
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Tanisha" wrote in message
...
Hello Everyone,
Can some one please assist me in writing a code to move one "named"
worksheet to the begining of a workbook and I would like for this Macro to
Auto Run when the workbook is closed?