VBA Code:
Sub ExcelVersionChecker()
'
Dim ExcelVersion As Integer
'
ExcelVersion = Application.Version
'
Select Case ExcelVersion
Case 8:
ThisVersionfExcel = "Excel 97"
Case 9:
ThisVersionfExcel = "Excel 2000"
Case 10:
ThisVersionfExcel = "Excel 2002"
Case 11:
ThisVersionfExcel = "Excel 2003"
Case 12:
ThisVersionfExcel = "Excel 2007"
Case 14:
ThisVersionfExcel = "Excel 2010"
Case 15:
ThisVersionfExcel = "Excel 2013"
Case 16:
' Test for Excel 2016, 2019 and 365 in Win and Mac Excel
Dim Case16Result As String
'
On Error Resume Next
'
' Test for the XMATCH function available in Excel 365
Case16Result = Application.Evaluate("=XMATCH(5,{5,4,3,2,1})")
'
If Err = 0 Then
ThisVersionfExcel = "Excel 365"
Else
Err.Clear
'
' Test for the CONCAT function available in Excel 2019
Case16Result = Application.Evaluate("=CONCAT(""A"",""B"")")
'
If Err = 0 Then
ThisVersionfExcel = "Excel 2019"
Else
Err.Clear
ThisVersionfExcel = "Excel 2016"
End If
End If
Case Else:
ThisVersionfExcel = "Excel Unknown Version of " & ExcelVersion
End Select
'
MsgBox "You are running " & ThisVersionfExcel & " on " & Application.OperatingSystem & "."
'
End Sub
Just want to see how accurate it is.