With monday.comâ€™s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Below is my code. Noobie question here. I am sure this is easier than I am thinking and its probably just a simple end but just wanting to make sure I do it right. After " if fnamelog = "inj-r" or fnamelog = "log-r" or fnamelog = "ros-r" then" I just want the program to do nothing if it find filenames with these last 5 characters and move on to the else. Is this a simple as putting in an end?

=============

CODE

=============

Set objTextStream = objFSO.OpenTextFile(objFolder & "\" & file.Name)

fname = left(file.name,11)

fnamelog = right(file.name,5)

if fnamelog = "inj-r" or fnamelog = "log-r" or fnamelog = "ros-r" then

else fname = "BC-BBA-PRVW" or fname ="BC-BBN-PRVW" or fname ="BC-BBM-PRVW" or fname ="BC-BBA-RCPS" or fname = "BC-BBN-RCPS" or fname ="BC-BBM-RCPS" or fname ="BC-BBA-LGNS" or fname ="BC-BBN-LGNS" or fname ="BC-BBM-LGNS" then

Do While Not objTextStream.AtEndOfStream

a1=objTextStream.ReadLine

j=instr(trim(a1),"TEXT.dtd")

x=instr(trim(a1),".dtd")

if j > 0 then

=============

CODE

=============

Set objTextStream = objFSO.OpenTextFile(objFol

fname = left(file.name,11)

fnamelog = right(file.name,5)

if fnamelog = "inj-r" or fnamelog = "log-r" or fnamelog = "ros-r" then

else fname = "BC-BBA-PRVW" or fname ="BC-BBN-PRVW" or fname ="BC-BBM-PRVW" or fname ="BC-BBA-RCPS" or fname = "BC-BBN-RCPS" or fname ="BC-BBM-RCPS" or fname ="BC-BBA-LGNS" or fname ="BC-BBN-LGNS" or fname ="BC-BBM-LGNS" then

Do While Not objTextStream.AtEndOfStrea

a1=objTextStream.ReadLine

j=instr(trim(a1),"TEXT.dtd

x=instr(trim(a1),".dtd")

if j > 0 then

i.e.

if fname = "BC-BBA-PRVW" or fname ="BC-BBN-PRVW" or fname ="BC-BBM-PRVW" or fname ="BC-BBA-RCPS" or fname = "BC-BBN-RCPS" or fname ="BC-BBM-RCPS" or fname ="BC-BBA-LGNS" or fname ="BC-BBN-LGNS" or fname ="BC-BBM-LGNS" then

Do While Not objTextStream.AtEndOfStrea

a1=objTextStream.ReadLine

j=instr(trim(a1),"TEXT.dtd

x=instr(trim(a1),".dtd")

if j > 0 then

...

if NOT (fnamelog = "inj-r" or fnamelog = "log-r" or fnamelog = "ros-r") then

'...

Do While Not objTextStream.AtEndOfStrea

a1=objTextStream.ReadLine

j=instr(trim(a1),"TEXT.dtd

x=instr(trim(a1),".dtd")

if j > 0 then

-Brian

use exit sub or exit function

i.e.

if fnamelog = "inj-r" or fnamelog = "log-r" or fnamelog = "ros-r" then

exit function ' i assume that is function

else fname = "BC-BBA-PRVW" or fname ="BC-BBN-PRVW" or fname ="BC-BBM-PRVW" or fname ="BC-BBA-RCPS" or fname = "BC-BBN-RCPS" or fname ="BC-BBM-RCPS" or fname ="BC-BBA-LGNS" or fname ="BC-BBN-LGNS" or fname ="BC-BBM-LGNS" then

Do While Not objTextStream.AtEndOfStrea

a1=objTextStream.ReadLine

j=instr(trim(a1),"TEXT.dtd

x=instr(trim(a1),".dtd")

if j > 0 then

if NOT (fnamelog = "inj-r" and fnamelog = "log-r" and fnamelog = "ros-r") then

reverse the logic?

if seems are are no other cases...so why not...

if NOT (fnamelog = "inj-r" or fnamelog = "log-r" or fnamelog = "ros-r") then

'...

Do While Not objTextStream.AtEndOfStrea

a1=objTextStream.ReadLine

j=instr(trim(a1),"TEXT.dtd

x=instr(trim(a1),".dtd")

if j > 0 then

Dim wshShell, objEnvironment

Set wshShell = CreateObject("WScript.Shel

Set objEnvironment = wshShell.Environment("Syst

wshShell.Run objEnvironment.Item("COMSP

if fname = "BC-BBA-PRVW" or fname ="BC-BBN-PRVW" or fname ="BC-BBM-PRVW" or fname ="BC-BBA-RCPS" or fname = "BC-BBN-RCPS" or fname ="BC-BBM-RCPS" or fname ="BC-BBA-LGNS" or fname ="BC-BBN-LGNS" or fname ="BC-BBM-LGNS" then

Do While Not objTextStream.AtEndOfStrea

a1=objTextStream.ReadLine

j=instr(trim(a1),"TEXT.dtd

x=instr(trim(a1),".dtd")

if j > 0 then

here is the thread..

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21825084.html

All Courses

From novice to tech pro — start learning today.

Set objTextStream = objFSO.OpenTextFile(objFol

fname = left(file.name,11)

fnamelog = right(file.name,5)

Select Case fnamelog

Case "inj-r","log-r","ros-r"

Case else

Select Case fname

Case "BC-BBA-PRVW","BC-BBN-PRVW

Do While Not objTextStream.AtEndOfStrea

a1=objTextStream.ReadLine

j=instr(trim(a1),"TEXT.dtd

x=instr(trim(a1),".dtd")

if j > 0 then

'.......

Case else

End select

end select