i read a txt file line by line with the typical Line Input #1, LINEA
based:
Dim LINEA as String
LINEA="kkjkhk retta casa palazzo"
now i need to skip this line, during the loop, if contain retta or casa or palazzo
possible?
SKIP line if contain 3 value
-
- Administrator
- Posts: 79447
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: SKIP line if contain 3 value
Code: Select all
If LINEA Like "*retta*" Or LINEA Like "*casa*" Or LINEA Like "*palazzo*" Then
' Skip this line
Else
' Do something with this line
' ...
End If
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 614
- Joined: 14 Nov 2012, 16:06
Re: SKIP line if contain 3 value
Code: Select all
Sub M_snb()
sn=filter(filter(filter(split(createobject("scripting.filesystemobject").opentextfile("G:\OF\example.txt").readall,vbcrlf),"retta",0),"casa",0),"palazzo",0)
cells(1).resize(ubound(sn))=application.transpose(sn)
End sub