Function ricerca(lab As Range, ByVal etichetta As String) As Integer
Dim f As Integer
Dim c As Integer
'Rem v = InputBox("Tell me, the currency you need"))
f = -1
For c = 1 To lab.Columns.Count Step 1
If lab.Cells(1, c).Value Like "*" & etichetta & "*" Then
f = c
End If
ricerca = f
Next c
End Function
Set dset = Range("A2 : N100") 'a)identifico il set di dati, nel foglio di lavoro da elaborare;
Dim cambio As String
Dim x As Integer
cambio = InputBox("Che valuta stai cercando?") 'b)richiesta dell'utente 'chiedo all'utente la valuta da analizzare
x = ricerca(Range(dset.Cells(1, 2), dset.Cells(1, 13)), cambio)
If x = -1 Then
MsgBox ("Non è stato possibile procedere!")
ElseIf MsgBox("colonna = " & x) Then
End If
MsgBox ("Elaborazione Terminata") 'informa l'utente che l'elaborazione è terminata
End Sub
|