D
Daniel R. Young
I am so close to finishing this button but I am getting the error:
Compile error:
Procedure declartion does not match description of event or procedrue having
the same name.
Here is my code:
Private Sub Commandbutton1_click(ByVal Sh As Object, ByVal Target As Range)
Worksheets("Report").Unprotect
Dim rng As Range, rngA As Range
If Target.Value("Report").Range("A1:J9769") = "No Photo" Then
Set rng = Target.Offset(-3, -1)
Selection.Font.ColorIndex = 2
Selection.Interior.ColorIndex = 2
Range("A1:J9769").Select
Selection.Copy
Dim WDApp As Object
Dim WDDoc As Object
Dim myDocName As String
myDocName = "Survey Report.doc"
Set WDApp = CreateObject("Word.Application")
WDApp.Visible = True
Set WDDoc = WDApp.documents.Open("F:\Survey Test\Word\Survey Report.doc")
Worksheets("Report").Protect
ws_exit:
Application.EnableEvents = True
End Sub
Can somone help?
Thank you,
Daniel
Compile error:
Procedure declartion does not match description of event or procedrue having
the same name.
Here is my code:
Private Sub Commandbutton1_click(ByVal Sh As Object, ByVal Target As Range)
Worksheets("Report").Unprotect
Dim rng As Range, rngA As Range
If Target.Value("Report").Range("A1:J9769") = "No Photo" Then
Set rng = Target.Offset(-3, -1)
Selection.Font.ColorIndex = 2
Selection.Interior.ColorIndex = 2
Range("A1:J9769").Select
Selection.Copy
Dim WDApp As Object
Dim WDDoc As Object
Dim myDocName As String
myDocName = "Survey Report.doc"
Set WDApp = CreateObject("Word.Application")
WDApp.Visible = True
Set WDDoc = WDApp.documents.Open("F:\Survey Test\Word\Survey Report.doc")
Worksheets("Report").Protect
ws_exit:
Application.EnableEvents = True
End Sub
Can somone help?
Thank you,
Daniel