Screenshot I use this script (found here) and did a little of modification, but now is not presenting the information found, I got the phrase "By Wedge" in the cells C14, C15 and C22, but only prints the info corresponding to C14:
Function WedgeUsadaEn()
Dim myArray() As Variant
Dim x As Long, y As Long, lNumElements As Long
Dim msg As String
With Worksheets("OBQ").Range("C13:C33")
Set c = .Find("By Wedge", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
ReDim Preserve myArray(y)
myArray(y) = c.Offset(0, -2).Value
y = y + 1
Set c = .FindNext(c)
If c Is Nothing Then
GoTo DoneFinding
End If
Loop While c.Address <> firstAddress
End If
DoneFinding:
End With
lNumElements = UBound(myArray) - LBound(myArray)
If lNumElements = 1 Then
msg = myArray(0)
Else
For x = LBound(myArray) To UBound(myArray)
If x < (lNumElements - 1) Then
msg = msg & myArray(x) & ", "
Else
msg = msg & myArray(x)
End If
Next x
End If
WedgeUsadaEn = msg
End Function
I hope anyone can bring me some light about what is this happening
If I keep it as sub and not a function, like the original, all the data is presente properly