This probably shouldn't be on the main form, maybe better in a module, but here it is anyway.

The Array FineArr() is defined as public in a module, as are the other variables used here...
AGet, Tmp3, As String
A_Get As Double
and SBValue and K as Long

OverWriteGFile (Tmp3) is commented out, as it's calling a sub in a module that I don't expect to work yet.

I get "Compile Error, Type Mismatch', with "Private Sub Command5_Click()" in the yellow block, and FineArr as below in a Blue block.

Private Sub Command5_Click()

AGet = A_Get
Tmp3 = ReadFile(File2.Path & "/" & File2.List(File2.ListIndex))
FineArr2 = Split(Tmp3, vbNewLine)

For K = LBound(FineArr2) To UBound(FineArr2)
If InStr(FineArr2, AGet) Then FineArr(K) = FineArr(K) & " Z" & SBValue
Next K

Join(FineArr2, vbNewLine) = Tmp3
Form1.RichTextBox1 = Tmp3
'OverWriteGFile (Tmp3)
Form1.RichTextBox1 = Tmp2

End Sub


I though that because "FineArr" is defined as String, it would be okay to search inside it for "AGet", but maybe that's not the problem? I could understand if I was searching a string for a substring that was actually a double, as in "A_Get". What is the problem/problems here?