I'm currently developing a utility for my job with which you can check how often a certain date or name or whatever is in an Excel-sheet.
I have searched the Visual Basic Express help, this forum, internet and other Programming forums for the Range.Find and FindNext methods but I just cannot find the right solution for my problem and so I just cannot get it to work.
Who can just give me an example of how to count how often a value exists? Example: I want to know how often the date 4/6/2009 is in an Excel-sheet. What is the code for this??
Something I had so far:
Who can just give me an example of how to count how often a value exists?Any help would be really appreciated!!
I have searched the Visual Basic Express help, this forum, internet and other Programming forums for the Range.Find and FindNext methods but I just cannot find the right solution for my problem and so I just cannot get it to work.
Who can just give me an example of how to count how often a value exists? Example: I want to know how often the date 4/6/2009 is in an Excel-sheet. What is the code for this??
Something I had so far:
VB.NET:
Private Sub FindDatum(ByVal TeZoekenDatum As String)
Dim ExcelProg As Object = CreateObject("Excel.Application")
Dim TicketFile As Object = ExcelProg.Workbooks.Open(OpenFileDialog1.FileName)
Dim TicketList As Object = TicketFile.Worksheets(1)
Dim Aantal As Integer
Dim FoundMatches As Integer
Dim misValue As Object = System.Reflection.Missing.Value
For Aantal = 1 To FoundMatches
TicketList.Columns("E").Find(TeZoekenDatum, misValue, misValue, misValue, misValue, misValue, misValue, misValue)
TicketList.Columns("E").FindNext(TeZoekenDatum)
FoundMatches = FoundMatches + 1
Next
FoundMatches = FoundMatches - 1
Label5.Text = FoundMatches
End Sub
Who can just give me an example of how to count how often a value exists?Any help would be really appreciated!!