VBA - Print function selecting wrong Type of Change option :   I have code below for a print function created in VBA. When I select Return from leave under the drop down of the Type of Change field and print, it prints as a salary change type, not return from leave. I cant see where I went wrong in my code or what is causing the issue... Any thoughts? Thanks in advance![![][1]][1]
  
    Sub pcf_print()
    
    Dim ws As Worksheet
    Dim datasheet As Worksheet
    Dim fs As Object
    Dim str As String
    Dim bool As Boolean

    If Len(ActiveSheet.Name) < 3 Then
        MsgBox "This worksheet is not a PCF"
        Exit Sub
    End If
    
    If Left(ActiveSheet.Name, 3) <> "PCF" Then
        MsgBox "This worksheet is not a PCF"
        Exit Sub
    End If
    
    'MsgBox Right(ActiveSheet.Name, Len(ActiveSheet.Name) - 1 - InStr(ActiveSheet.Name, " v")) 'Right(ActiveSheet.Name, 4)
    If InStr(ActiveSheet.Name, " vv") Then
        If (CDbl(Right(ActiveSheet.Name, Len(ActiveSheet.Name) - 1 - InStr(ActiveSheet.Name, " vv") - 1)) >= 1.2 And (ActiveSheet.Range("F10") = "(select)" Or ActiveSheet.Range("F10") = "" Or ActiveSheet.Range("F10") = "(sélect.)")) Then
            MsgBox "This form has not been completed"
            Exit Sub
        End If
    Else
        If (CDbl(Right(ActiveSheet.Name, Len(ActiveSheet.Name) - 1 - InStr(ActiveSheet.Name, " v"))) < 1.2 And (ActiveSheet.Range("F9") = "(select)" Or ActiveSheet.Range("F9") = "")) Or (CDbl(Right(ActiveSheet.Name, Len(ActiveSheet.Name) - 1 - InStr(ActiveSheet.Name, " v"))) >= 1.2 And (ActiveSheet.Range("F10") = "(select)" Or ActiveSheet.Range("F10") = "" Or ActiveSheet.Range("F10") = "(sélect.)")) Then
            MsgBox "This form has not been completed"
            Exit Sub
        End If
    End If
    
    Set datasheet = ActiveSheet
    
    If ActiveWorkbook.Worksheets("Form Lists").Range("CorpOrStore") = "Corp" Then
        str = "Corporate"
    Else
        str = "Stores"
    End If
    
    Set fs = CreateObject("Scripting.FileSystemObject")
    
    bool = fs.FolderExists("H:\HR\Online PCF Archive\" & str & "\" & Trim(datasheet.Range("StoreDeptResult")) & "\")
       
    If Not bool Then
        MkDir "H:\HR\Online PCF Archive\" & str & "\" & Trim(datasheet.Range("StoreDeptResult")) & "\"
    End If
    
    If InStr(ActiveSheet.Name, " vv") Then
        If CDbl(Right(ActiveSheet.Name, Len(ActiveSheet.Name) - 1 - InStr(ActiveSheet.Name, " vv") - 1)) >= 1.2 Then
            ActiveWorkbook.SaveAs "H:\HR\Online PCF Archive\" & str & "\" & Trim(datasheet.Range("StoreDeptResult")) & "\" & Replace(datasheet.Range("F10"), "/", "_") & " for " & datasheet.Range("J17") & ", " & datasheet.Range("F17") & " effective " & Month(datasheet.Range("F12")) & "-" & Day(datasheet.Range("F12")) & "-" & Year(datasheet.Range("F12")) & ".xls"
        End If
    Else
        If CDbl(Right(ActiveSheet.Name, Len(ActiveSheet.Name) - 1 - InStr(ActiveSheet.Name, " v"))) >= 1.2 Then
            ActiveWorkbook.SaveAs "H:\HR\Online PCF Archive\" & str & "\" & Trim(datasheet.Range("StoreDeptResult")) & "\" & Replace(datasheet.Range("F10"), "/", "_") & " for " & datasheet.Range("J17") & ", " & datasheet.Range("F17") & " effective " & Month(datasheet.Range("F12")) & "-" & Day(datasheet.Range("F12")) & "-" & Year(datasheet.Range("F12")) & ".xls"
        Else
            ActiveWorkbook.SaveAs "H:\HR\Online PCF Archive\" & str & "\" & Trim(datasheet.Range("StoreDeptResult")) & "\" & datasheet.Range("F9") & " for " & datasheet.Range("J16") & ", " & datasheet.Range("F16") & " effective " & Month(datasheet.Range("F11")) & "-" & Day(datasheet.Range("F11")) & "-" & Year(datasheet.Range("F11")) & ".xls"
        End If
    End If
        
    Set ws = ActiveWorkbook.Worksheets("Payroll Forms")
    
    If Right(ActiveSheet.Name, 5) = "v1.20" Then
        ActiveWorkbook.Worksheets("Form Lists").Unprotect "0nl1n3"
        ActiveWorkbook.Worksheets("Form Lists").Range("B8") = "A1:G76"
        ActiveWorkbook.Worksheets("Form Lists").Range("B9") = "A80:G157"
        ActiveWorkbook.Worksheets("Form Lists").Range("B10") = "A160:G225"
        ActiveWorkbook.Worksheets("Form Lists").Range("B11") = "A228:G259"
        ActiveWorkbook.Worksheets("Form Lists").Range("B12") = "A228:G259"
        ActiveWorkbook.Worksheets("Form Lists").Range("B13") = "A228:G259"
        ActiveWorkbook.Worksheets("Form Lists").Range("B14") = "A263:G338"
        ActiveWorkbook.Worksheets("Form Lists").Range("B15") = "A263:G338"
        ActiveWorkbook.Worksheets("Form Lists").Range("B16") = "A343:G367"
        ActiveWorkbook.Worksheets("Form Lists").Range("B17") = "A263:G338"
        ActiveWorkbook.Worksheets("Form Lists").Range("B18") = "A160:G225"
        ActiveWorkbook.Worksheets("Form Lists").Range("B19") = "A370:G420"
        ActiveWorkbook.Worksheets("Form Lists").Protect "0nl1n3"
    End If
    
    If Right(ActiveSheet.Name, 5) = "v1.20" Or Right(ActiveSheet.Name, 5) = "v1.21" Or str = "Corporate" Then
        ws.PageSetup.PrintArea = ActiveWorkbook.Worksheets("Form Lists").Range("H2")
    Else
        ws.PageSetup.PrintArea = ActiveWorkbook.Worksheets("Form Lists").Range("i2")
    End If
    
    ActiveWorkbook.Unprotect "0nl1n3"
    ws.Visible = xlSheetVisible
    ws.PrintOut
    ws.Visible = xlSheetHidden
    ActiveWorkbook.Protect "0nl1n3"
    
    ActiveWorkbook.Close False
    
End Sub


  [1]: https://i.stack.imgur.com/iFZbg.png