Is it possible for me to manipulate this code such that if the filename is OPEX Variance Analysis rev.2.xls it will run the macro, otherwise, nothing will happen.
Here is the code that I have so far.
Option Explicit
Private Sub Workbook_Open()
Dim filename As String
If filename = "Y:IQ38316DataExcelOPEX-CAPEX Input SheetsOPEX Variance Analysis rev.2.xls" Then
'set range you want to clear
Worksheets("Variance Analysis").Range("K30:T53").ClearContents
'returns OrgCode Values back to default "*" value
Worksheets("Variance Analysis").Range("C8:C10").Value = "*"
'returns month back to default of "01-January"
Worksheets("Variance Analysis").Range("B1").Value = "'01"
End If
End Sub
Here is the code that I have so far.
Option Explicit
Private Sub Workbook_Open()
Dim filename As String
If filename = "Y:IQ38316DataExcelOPEX-CAPEX Input SheetsOPEX Variance Analysis rev.2.xls" Then
'set range you want to clear
Worksheets("Variance Analysis").Range("K30:T53").ClearContents
'returns OrgCode Values back to default "*" value
Worksheets("Variance Analysis").Range("C8:C10").Value = "*"
'returns month back to default of "01-January"
Worksheets("Variance Analysis").Range("B1").Value = "'01"
End If
End Sub