kathleenfarber
New Member
- Joined
- Sep 26, 2016
- Messages
- 32
- Office Version
- 365
- Platform
- Windows
I'd like to change the following code FROM DAYS / TO DAYS and instead just run it if it has a Y in the cell.
Any help appreciated.
Any help appreciated.
VBA Code:
If .Range("B3").Value = Empty Then
MsgBox "Please select a correct template from the drop down list"
.Range("G3").Select
Exit Sub
End If
TemplRow = .Range("B3").Value 'Set Template Row
TemplName = .Range("G3").Value 'Set Template Name
FrDays = .Range("L3").Value 'Set From Days
ToDays = .Range("N3").Value 'Set To Days
DocLoc = Sheet2.Range("F" & TemplRow).Value 'Word Document Filename
'Open Word Template
On Error Resume Next 'If Word is already running
Set WordApp = GetObject("Word.Application")
If Err.Number <> 0 Then
'Launch a new instance of Word
Err.Clear
'On Error GoTo Error_Handler
Set WordApp = CreateObject("Word.Application")
WordApp.Visible = True 'Make the application visible to the user
End If