Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Disable macro security for selected workbook | Excel Discussion (Misc queries) | |||
select workbook macro | Excel Discussion (Misc queries) | |||
run macro on workbook open | Excel Discussion (Misc queries) | |||
Extract specific data into its own workbook via macro? | Excel Discussion (Misc queries) | |||
Why is workbook so slow opening? | Excel Discussion (Misc queries) |