Hello,
I have a bigger macro that open many TXT files one by one, search for different values and
copy after in a data sheet. At one point I need to find the value for "Code" which is a number.
If TXT file is opened by Excel, this value is in column A and the position of row can be different from file to file. But, is always after word "CODIGO".
An partial example of TXT file is below:
TIEMPO;01:53;
CODIGO;
23;MAX;
I have below code, which is used with some modifications in other parts of macro for different parameters, but obviously is not good for me. This code is giving always the result "CODIGO". I need to find next value (23).
Please help me to find correct value. I know that is easy, but not for me
Thank you.
I have a bigger macro that open many TXT files one by one, search for different values and
copy after in a data sheet. At one point I need to find the value for "Code" which is a number.
If TXT file is opened by Excel, this value is in column A and the position of row can be different from file to file. But, is always after word "CODIGO".
An partial example of TXT file is below:
TIEMPO;01:53;
CODIGO;
23;MAX;
I have below code, which is used with some modifications in other parts of macro for different parameters, but obviously is not good for me. This code is giving always the result "CODIGO". I need to find next value (23).
Code:
If UBound(Split(ReadData, ";")) >= 1 Then If InStr(1, Split(ReadData, ";")(0), "CODIGO") > 0 Then
Code = Split(ReadData, ";")(0)
End If
End If
Please help me to find correct value. I know that is easy, but not for me
Thank you.