Yes, you must be very precise in defining your demands!
This is the function that does what you have defined up to now:
Public Function Matchdigits2(string1 As String, string2 As String) As String
Dim length As Integer
length1 = Len(string1)
length2 = Len(string2)
Matchdigits2 = ""
For l1 = 1 To length1
For l2 = 1 To length2
If Mid(string1, l1, 1) = Mid(string2, l2, 1) Then _
Matchdigits2 = Matchdigits2 & Mid(string1, l1, 1)
Next l2
Next l1
End Function
You did not give rules for multiple occurence of a digit. This function will
put a digit in the result as many times as it occurs. Is that what you want?
Regards,
Stefi
€˛toyota58€¯ ezt Ć*rta:
Very sorry again but ...the formula can only work in a certain way.
Example
Cell A1 = 2469
Cell A2 = 1359
Cell A3 = 9 This works OK
But it won't work if...
Cell A1 = 24569
Cell A2 = 69
Cell A3 = No Return
Cell A1 = 134
Cell A2 = 467
Cell A3 = No Return
Sorry to trouble you all but it was my mistake not to explain in
detail...
|