Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stuck on syntax in vbscript

Status
Not open for further replies.

naikadit

Technical User
Jun 30, 2008
22
US
hi guys this is very simple I am newsie and need you help

the following part is not working for me. I dont know I guess the fault is in the if statement below

Dim chkFl15
chkFl15 = 0

Dim cnt15
Dim mark15

cnt15 = objWorkbook.Worksheets.Count
mark15 = 1

Do While mark15 <= cnt15
If objworkbook.Worksheets(mark15).Name = "Lac-Sac-Rac" and objworkbook.Worksheets(mark15).Name = "Utran Relations" Then ----- this statement
chkFl15 = 1
exit do
end if
mark15=mark15+1
Loop




if chkFl15 = 0 then
objtxtStream.Writeline "Scripts for Relations cannot be generated- Missing Utran relations or Lac-Sac-Rac Tab"



else
 
I'd replace And with Or in your If statement.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top