Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
nsv
 
Posts: n/a
Default Run macro when opening workbook


I need the cursor to be in a specific cell when opening the workbook.
Easily done whith a small macro, but I'd prefer not to have any
pushbuttons; just go to the cell when the workbook is opened.
I guess it is peace of cake for most of you, but I can't find anything
usefull about automatic macros in the help text.

By the way, when talking macros and VB and Excel - what is the
definition of workbook? worksheet? file? spreadsheet?


--
nsv
------------------------------------------------------------------------
nsv's Profile: http://www.excelforum.com/member.php...o&userid=26500
View this thread: http://www.excelforum.com/showthread...hreadid=402070

  #2   Report Post  
HiArt
 
Posts: n/a
Default


Hi,

If you call your macro "Auto_Open()" that should do the trick, although
I beleive you should use "Workbook_Open()" as described he
http://www.cpearson.com/excel/events.htm.

I treat workbook = (excel) file and worksheet = spreadsheet, although
this is a simplistic view. Workbook and Worksheet as collections of
which the (excel) file and spreadsheet are possible members.

HTH

Art


--
HiArt
------------------------------------------------------------------------
HiArt's Profile: http://www.excelforum.com/member.php...o&userid=19953
View this thread: http://www.excelforum.com/showthread...hreadid=402070

  #3   Report Post  
R.VENKATARAMAN
 
Posts: n/a
Default

this is possible perhaps if you create an event macro for < thisworkbook.
open vb editor (alt+F11)
hit control+r(if the vb project window is not opern)
click the particular workbook or file
right click <thisworkbook
click view code

introduce this macro
=========
Private Sub Workbook_Open()
Range("a1").Select
End Sub
===================
save the workbook.

everytime you open this workbook A1 will be highlighted.


--
remove $$$ from email addresss to send email




"nsv" wrote in message
...

I need the cursor to be in a specific cell when opening the workbook.
Easily done whith a small macro, but I'd prefer not to have any
pushbuttons; just go to the cell when the workbook is opened.
I guess it is peace of cake for most of you, but I can't find anything
usefull about automatic macros in the help text.

By the way, when talking macros and VB and Excel - what is the
definition of workbook? worksheet? file? spreadsheet?


--
nsv
------------------------------------------------------------------------
nsv's Profile:

http://www.excelforum.com/member.php...o&userid=26500
View this thread: http://www.excelforum.com/showthread...hreadid=402070



  #4   Report Post  
Stefi
 
Posts: n/a
Default

Private Sub Workbook_Open()
Range("A1").Select
End Sub

Replace A1 as needed!

To create Sub Workbook_Open():
Tools-Macros-Visual Basic
Right click on Thisworkbook in your VBAProject (yourworkbookname)- View code
In the left dropdown list select Workbook
The frame
Private Sub Workbook_Open()

End Sub
automatically appears.

Regards,
Stefi


In th


€žnsv€ť ezt Ă*rta:


I need the cursor to be in a specific cell when opening the workbook.
Easily done whith a small macro, but I'd prefer not to have any
pushbuttons; just go to the cell when the workbook is opened.
I guess it is peace of cake for most of you, but I can't find anything
usefull about automatic macros in the help text.

By the way, when talking macros and VB and Excel - what is the
definition of workbook? worksheet? file? spreadsheet?


--
nsv
------------------------------------------------------------------------
nsv's Profile: http://www.excelforum.com/member.php...o&userid=26500
View this thread: http://www.excelforum.com/showthread...hreadid=402070


  #5   Report Post  
nsv
 
Posts: n/a
Default


I found out that it is quite important to put it in "Thisworkbook" and
not in "Sheet 1", but now it works - so - thanks a lot all of you!!

NSV


--
nsv
------------------------------------------------------------------------
nsv's Profile: http://www.excelforum.com/member.php...o&userid=26500
View this thread: http://www.excelforum.com/showthread...hreadid=402070

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable macro security for selected workbook Jan Excel Discussion (Misc queries) 1 June 15th 05 07:56 AM
select workbook macro Nigel Excel Discussion (Misc queries) 3 May 16th 05 01:45 PM
run macro on workbook open kevin Excel Discussion (Misc queries) 3 March 4th 05 10:12 AM
Extract specific data into its own workbook via macro? Adrian B Excel Discussion (Misc queries) 2 February 24th 05 06:09 AM
Why is workbook so slow opening? Carl Nielsen Excel Discussion (Misc queries) 1 January 28th 05 12:07 AM


All times are GMT +1. The time now is 04:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"