personal.xlsb not getting activeworkbook

biswajit.becs

New Member
Joined
Jun 22, 2011
Messages
2
hi,

i have created a module in personal.xlsb.i want it to autometically run when excel starts.
Code:
Private Sub Auto_Open()
Dim sh As Worksheet
For Each sh In [COLOR="Blue"]ActiveWorkbook[/COLOR].Worksheets
sh.Cells.Replace What:="aaa", Replacement:="xxx"
Next
End Sub
but when opening a workbook getting runtime error
how to get rid of this?

thanks for help in advance
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
i want to get that code run whenever any excel workbook opens to my computer.

actually my intention is to get all "aaa" to be replaced by "xxx" to all worksheets whenever any workbook is opened to my computer.

pl. write further if any clarification needed.
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,292
Members
452,902
Latest member
Knuddeluff

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