Auto run of macros immediately after opening the files

G

Guest

hai
i saved the worksheet by placing the cursor at some cell (say a200) and i
had closed the file. If i open the file, the cursor/worksheet should start
from first cell (say a1) or any cell which i assign
Pls help me to solve my problem
 
C

carlo.ramundo

Hey gane
to do that, open your excel sheet, press Alt + F11,
then you should see on the left side your sheets and
the whole workbook, if not press ctrl+r....double click
on the workbook and choose instead of (General) -->
workbook. this should lead to this:
---------------------------------------------------
Private Sub Workbook_Open()

End Sub
---------------------------------------------------
Now you can paste following between those lines:
---------------------------------------------------
ActiveSheet.Range("A1").Select
---------------------------------------------------
Where you can change the Range to what you want.

Close the workbook and reopen it.

hth

Carlo
 
G

Guest

Sub Workbook_Open()
'Do your stuff here...

Application.Quit
Sub End


Right-click on sheet 'View Code'
Private Sub Auto_Open()
'Stuff
Sub End
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top