NicolaasH
Technical User
- Sep 11, 2007
- 38
Hi,
I would like to run through a column of a list (ListObject) in my Excel sheet to check the value which is in it, in order to find out what the highest number is in the list. How can I point to a certain cell in a list and read its value?
I now have something like this (unknown code marked by <<< >>>):
Thanks for your help!
I would like to run through a column of a list (ListObject) in my Excel sheet to check the value which is in it, in order to find out what the highest number is in the list. How can I point to a certain cell in a list and read its value?
I now have something like this (unknown code marked by <<< >>>):
Code:
Function CheckMaxCellIndex(CheckWorksheet As String, CheckColumn As Integer, MaxCell As Integer) As Integer
Dim LastRowOfList As Integer, CheckRow As Integer
Set objListRowSearch = ThisWorkbook.Worksheets(CheckWorksheet).ListObjects(1)
LastRowOfList = objListRowSearch.ListRows.Count
'<<<
For CheckRow = 1 To LastRowOfList
MaxCellCheck = objListRowSearch.Cells(CheckRow, CheckColumn)
'>>>
If MaxCellCheck > MaxCell Then MaxCell = MaxCellCheck
Next CheckRow
CheckMaxCellIndex = MaxCell
End Function
Thanks for your help!