genevievebr0
08-06-2014, 08:06 AM
Hi,
I am very new to VBA coding. This stuff is usually left to my colleague but he is on vacation. I copied the greeting macro from another of his Excel files. It runs perfectly when I open the Visual basic. However, it doesn't run automatically when I open the document. Could somebody please help me, I am desperate.
Here's the code :
Private Sub Greeting()
' Will run automatically when the workbook is opened.
Dim ws As Worksheet
Dim Msg As String
Dim Style As Long
Dim Title As String
Dim Response As Long
Dim i As Long
Dim wb As Workbook
Application.Run "Workbook_Open"
Application.Run "ProtectSheets"
MsgBox ("Le classeur Excel est prêt à l'emploi." & Chr(10) & "The Excel workbook is ready for use.")
End Sub
Also, is there a way to copy and paste the VBA code in the forum without having to change color manually?
Thank you very much!!!!
geneviève
I am very new to VBA coding. This stuff is usually left to my colleague but he is on vacation. I copied the greeting macro from another of his Excel files. It runs perfectly when I open the Visual basic. However, it doesn't run automatically when I open the document. Could somebody please help me, I am desperate.
Here's the code :
Private Sub Greeting()
' Will run automatically when the workbook is opened.
Dim ws As Worksheet
Dim Msg As String
Dim Style As Long
Dim Title As String
Dim Response As Long
Dim i As Long
Dim wb As Workbook
Application.Run "Workbook_Open"
Application.Run "ProtectSheets"
MsgBox ("Le classeur Excel est prêt à l'emploi." & Chr(10) & "The Excel workbook is ready for use.")
End Sub
Also, is there a way to copy and paste the VBA code in the forum without having to change color manually?
Thank you very much!!!!
geneviève