Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Microsoft VB for Applciation - XML file Result skip the else statement.

Status
Not open for further replies.

SierraV

Computer
Dec 24, 2018
1
Hi Guys,

I have this vb code : -

If LineCode <> NextLineCode Then
Call WriteHeaderStart(a)
SequenceNumber = 1
Call WriteSubLine(a)
NextLineCode = Worksheets("Entries").Cells(Itemrow + 1, 1)
Else
SequenceNumber = SequenceNumber + 1
Call WriteSubLine(a)
NextLineCode = Worksheets("Entries").Cells(Itemrow + 1, 1)
End If

If NextLineCode <> LineCode Then
Call WriteHeaderEnd(a)
NextLineCode = ""
End If

Itemrow = Itemrow + 1​

However the XML result doesn't go to the else statement, keeps on repeating the If and calls the WriteHeaderStart(a). Can anyone help?
 
Replies continue below

Recommended for you

Provide the code that defines the LineCode variable?

Edit... And the initial value for the NextLineCode variable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor