I am trying to develop a function to sample a range in vba to find a minimum value and once this value is determined put that value in an adjacent column. I am getting a compile error. I am trying to define a range starting at cell 2 going to cell 10. I am doing a loop so I am assigning the cells to a variable.
Code:
Dim myLowestRange As Range
Set myLowestRange = Range("D" & R1 + 1) [red]":" [/red] Range("D" & R1 + 10)
WorksheetFunction.Min (myLowestRange)
Also how do I put the myLowestRange into the adjacent cell?