::Global Macros::

jekstein

New Member
Joined
Aug 31, 2006
Messages
18
Can any one remind me how to create a global workbook macro that is not attached to a button or cell, it should just run when the workbook is open?

For example I want to create a code that checks all the cells for a value and if there is no value then it should load a Zero value in the cells.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
From the help section of VBA

Occurs when the workbook is opened.

Private Sub Workbook_Open()
Example
This example maximizes Microsoft Excel whenever the workbook is opened.

Private Sub Workbook_Open()
Application.WindowState = xlMaximized
End Sub


Just put that sub name in a module I think.

Good Luck

Hayden
 
Upvote 0

Forum statistics

Threads
1,202,912
Messages
6,052,520
Members
444,588
Latest member
ViJN

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top