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 cowski 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
Joined
Dec 24, 2018
Messages
1
Location
MY
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?
 
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

Back
Top