Dear Forum members
Can any one explain why the following little Function does not work ?
The attached workbook contains the named range.
Sub Test()
CylIMP = "10"""
CylSize = MetSize(CylIMP)
End Sub
Function MetSize(CylIMP)
Dim CylsAr(13, 1) As Variant
CylsAr = Range("Cylinders").Value ' ***
For a = 0 To 13
If CylIMP = CylsAr(a, 0) Then
CylSize = CylsAr(a, 1)
Exit For
End If
Next a
MetSize = CylSize
End Function
This gives an error message:- Compile error Can't assign to an array
The highlight is on the assignment line marked with asterixes
In hope
John
Bookmarks