I have a 100 row x 3 column table titled "WW60_STRI" where column 1 has increasing distance measurements in feet from 0.00ft at A1 to 999.99ft at A100.
I need to pull data from column 3 based on a range in column 1. specifically, I want to retrieve the max of col 3 range while col 1 ranges are <= 35.87ft. So I only want to look at col 3 range that correlate with col 1 range that is <= variable "s"
What would be the correct VBA syntax to use in my case? Thank you for your help. This is what I have so far:
Sub wshear()
Dim s As Double
s = 35.87
Dim row As Integer
Dim tbl As Range
Dim rng As Range
Set tbl = Range("WW60_STRI")
Set rng = tbl.Columns(1)
'find what position in col 1 the Split is at - position where depth > s
For Each cll In rng
If cll.Value > s Then
row = cll.row 'save row number
Exit For
End If
Next
'get length of array
Dim u As Integer
Dim l As Integer
Dim y As Integer
u = UBound(rng)
l = LBound(rng)
y = u - l + 1
'use position number "row" to define a range of cells in column 3
'get max/min out of that range
max_above_el_s = Application.WorksheetFunction.Max(Range(tbl(0, 3),tbl(row, 3))) 'I assume format is (row,col) confirm
max_below_el_s = Application.WorksheetFunction.Max(Range(tbl(row+1, 3),tbl(y, 3))) 'I assume format is (row,col) confirm
End Sub