View Single Post
  #4   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

Did you put it where directed?

What did you get?

--
HTH

Bob Phillips

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

"Tanisha" wrote in message
...
I Tried this. It didnt work...I dont know what I am doing wrong
this what I inputed:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
With ThisWorkbook
.Worksheets("Solution Direct Tracking").Move

Befo=.Worksheets(1)
.Save
End With
End Sub

Tanisha

"Bob Phillips" wrote:

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?