I seem unable to write a basic sub function to return a value. I get a "compile error: Expected Function or Variable name", but the VBA seems to recognize the name. It even changes the capitalization when I update the function name.
I've looked at the help and even similiar posts on here. I assume it's a silly error, but can someone help me understand what I'm doing wrong. I've even made a simple function that isn't compiling:
Sub fIVe()
Dim i As Integer
i = 5
fIVe = i
End Sub
sClassification = getClassification("Activities")
ExportSheet "Activities", sFolderName, xWb, True, sClassification
Public Sub getClassification(sTabName As String)
Dim sClassificationCode As String, sClassification As String
'Step 1: Find Code for tab name
sClassificationCode = Application.WorksheetFunction.Index(Sheets("Cover Master").Range("B7:B12"), _
Application.WorksheetFunction.Match(sTabName, Sheets("Cover Master").Range("A7:A12"), 0), 1)
'Step 2: Find definition in Type Definitions tab using code from above
sClassification = Application.WorksheetFunction.Index(Sheets("Type Definitions").Range("F6:F21"), _
Application.WorksheetFunction.Match(sClassificationCode, Sheets("Type Definitions").Range("E6:E21"), 0), 1)
getClassification = sClassification
End Sub