Hi again,
Many thanks for all of your feedback and your compliments
Sorry about providing a case-sensitive search facility - I should have thought of that
Just make the highlighted changes shown, and the search will be case-insensitive:
Public Function gvaAlimenti(sLettereDaCercare As String) As Variant
Const sCOLONNA_ALIMENTI As String = "A"
Dim lUpperBound As Long
Dim lUltimaRiga As Long
Dim vaAlimenti As Variant
Dim sAlimento As String
Dim lRigaNo As Long
ReDim vaAlimenti(0)
With wksDatabase.Columns(sCOLONNA_ALIMENTI)
lUltimaRiga = .Cells(.Rows.Count, 1).End(xlUp).Row
If sLettereDaCercare <> vbNullString Then
For lRigaNo = 1 To lUltimaRiga
sAlimento = .Cells(lRigaNo, 1).Value
If InStr(1, sAlimento, sLettereDaCercare, vbTextCompare) > 0 Then
If UBound(vaAlimenti) <> 0 Then
As far as being born in Italy is concerned, I was born in Ireland to Irish non-Italian speaking parents, but when I retired I decided to try to learn to speak Italian - che lingua meravigliosa!
Best regards,
Greg M
P. S.
The following alternative method is probably better than the one I suggested above:
If InStr(LCase(sAlimento), LCase(sLettereDaCercare)) > 0 Then
Bookmarks