I'm not even sure if I'm on the right track, but I am trying to count the excel rows for a worksheet and display them in a textox on my form. I've assuming it would be best to write the row count in the form load procedure and this is what I've got so far, but no luck getting it to work. If it helps, the "Property" tables is one of the four worksheets created on-the-fly, when the program is started.

Private Sub Item_Number_Tracking(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles MyBase.load

Dim No_of_Items as Integer
Dim No_of_Items_Text as Integer

No_of_Items = PFC Xpress.Tables("Property").Rows.Count

If No_of_Items = 0 Then
   No_of_Items_Text = 1 & Me.NoOfItems.Text = 1

   Me.NoOfItems.Text =+1

End If

End Sub
4 Years
Discussion Span
Last Post by Lethugs

You could do some work around if your using database

Try to upload your excel to a datatable then count the number of rows

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.