' myXML is the name of the dataset ' to determine number of fields/columns in a dataset intCols = myXML.Tables("myTableName").Columns.Count
' to determine the number of records/rows in a dataset intRows = myXML.Tables("myTableName").Rows.Count
' to cycle through the field names to locate the index of the "Category" field For c = 0 To intCols - 1
sColTitle = myXML.Tables("myTableName").Columns(c).Caption
If sColTitle = "Category" Then
lngIndex = c' index of "Category" field Exit For
End If
Next