The function below check the name of a given sheet. The function stops at the instruction if sheetName.Length = 5 and ...
with the error: “Basic syntax error. Symbol sheetName already defined differently.”. Same error whatever name I give to this variable.
function isDaySheet(sheet)
dim sheetName as String
dim day as String
dim month as String
sheetName = sheet.name
if sheetName.Length = 5 and sheetName(2) = "-" then
day(0) = sheetName(0)
day(1) = sheetName(1)
month(0) = sheetName(3)
month(1) = sheetName(4)
if val(day) >= 1 and val(day) <= 31 and _
val(month) >=1 and val(month) <= 12 then
isDaySheet = True
else
isDaySheet = False
end if
else
isDaySheet = False
end if
end function
Is the attribute Length valid for a String?
What other mistake might I have done?