How do I add a macro to a document?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to add a macro:

Sub AutoOpen ()
Selection.Find.Execute Find Text:=MonmthNam
End Sub

What I wan this macro to DO is open my calendar on the current month, rather
than on January esch time. Purpose: to save scrolling down to every month
(except January) as the year progresses.

Can you help me?
 
Open your document. Hit Alt+F11 or Tools-->Macro-->Visual Basic Editor
(VBE). On the top-left, double-click ThisDocument under your document's
name. Type the following, instead of your code:

Private Sub Document_Open ()

Selection.Find.Execute Find Text:=MonmthNam

End Sub

Hit the SAVE diskette on the toolbar. Close the VBE.
*******************
~Anne Troy

www.OfficeArticles.com
 
Back
Top