Hi Team,
I am Reading text line using instr functions.
Text file is unstructured data, I want to Read those lines which contains month name in it.
(JAN,Feb,mar,apr,may,jun,jul aug,sep,oct,nov,dec)
Product currency princial Trade_Date Settlement_Date Maturity Date Interest Rate
ABC USD 145,356 25Jun2020 25Jul2020 18AUG2020 0.6
Below is my attempted code, is there any alternate way
or can we shorten the code.
also I am getting error when breaking the lines into multiple.
Thanks
mg
I am Reading text line using instr functions.
Text file is unstructured data, I want to Read those lines which contains month name in it.
(JAN,Feb,mar,apr,may,jun,jul aug,sep,oct,nov,dec)
Product currency princial Trade_Date Settlement_Date Maturity Date Interest Rate
ABC USD 145,356 25Jun2020 25Jul2020 18AUG2020 0.6
Below is my attempted code, is there any alternate way
or can we shorten the code.
also I am getting error when breaking the lines into multiple.
VBA Code:
Sub Read_String()
Dim s As String
Dim dict as new scripting.dictionary
s = "ABC USD 145,356 25Jun2020 25Jul2020 18AUG2020 0.6 "
if instr(s,"JAN")>0 & _
OR instr(s,"JAN")>0 & _
OR instr(s,"FEB")>0 & _
OR instr(s,"MAR")>0 & _
OR instr(s,"APR")>0 & _
OR instr(s,"MAY")>0 & _
OR instr(s,"JUN")>0 & _
OR instr(s,"JUL")>0 & _
OR instr(s,"AUG")>0 & _
OR instr(s,"SEP")>0 & _
OR instr(s,"OCT")>0 & _
OR instr(s,"NOV")>0 & _
OR instr(s,"DEC")>0 THEN
dict.Add s, s
End Sub
Thanks
mg