Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open, Selection_Change, Close Events 1

Status
Not open for further replies.

wilmargrp

Technical User
Apr 27, 2009
12
Another rookie question.

Using Excel 2007 - pretty sure I remember these (and other) Events where available through the (and i'm sure i'm screwing the name up here) Excel 2003 VBA UI (drop down box above code window) but now I'm not seeing a way to access them. Is this a VB.NET change and if so do I need to create a SUB?

(sorry if i butchered the terminology)
 


Hi,

alt+F11 toggles between the activesheet and VB Editor.

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
man i am so bad at trying to explain things...

try this again. if i want to perform a task, say clear the range $A$2:$B$10, when i open a workbook AND i want it to happen automatically (on open or close or anytime there is a cell change) what is the sub routine(s) to make that happen?
 


on open

The Workbook_Open event

on close

The Workbook_Close event

on a cell change

The Worksheet_Change event

alt+F11

ctrl+R

View the ThisWorkbook and Worksheet objects where these events reside.

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
??? still missing something here. if I have a sub...

Sub workbook_open()

calllog.Shapes(1).Left = 51.5

End Sub

on opening the workbook nothing happens (shape 1 doesn't move left to 51.5). what am i missing? yes i have macro enabled in a .xlsm workbook
 



In the ThisWorkbook object code window...
Code:
Private Sub Workbook_Open()

  calllog.Shapes(1).Left = 51.5

End Sub

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
THAT's IT! trying to do it at the Module level. thanks again!
 



In ALL of the Workbook and Worksheet objects, there are TWO drop down boxes above the code window.

Select the object from the drop down on the left and then you'll see all the events for that object in the drop down on the right.

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top