message box in worksheet

W

Wanna Learn

Hello I have a message box - the code is below.
( I do not want to use validation)
I understand that the box below is for when the worksbook is open but I do
not know how to change it so that is applies when cell D13 is selected in
worksheet entitled Form
Private Sub Workbook_Open()
Call Form23
End Sub
Sub Form23()
Dim Msg As String
Msg = "Complete Attached Form " & vbCrLf
Msg = Msg & "Submit Invoice" & vbCrLf
Msg = Msg & "Copy your Manager"
MsgBox Msg, vbInformation, "Don't Forget"
End Sub
 
O

OssieMac

Hi,

Right click on the worksheet name tab.
Select View Code
Copy the following into the VBA editor

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim isect As Object

Set isect = Application.Intersect(Target, Range("D13"))
If Not isect Is Nothing Then
Call Form23
End If

End Sub

Sub Form23()
Dim Msg As String
Msg = "Complete Attached Form " & vbCrLf
Msg = Msg & "Submit Invoice" & vbCrLf
Msg = Msg & "Copy your Manager"
MsgBox Msg, vbInformation, "Don't Forget"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top