0

I am having an issue that I am not able to sort it out. I need to pass a cell reference as an argument in a function.

Dim WshtRD As Worksheet

Dim DI As Date
Dim RngDI As Range
Set WshtRD = ActiveSheet
AI = DateValue(Range("O3"))
With WshtRD
Set RngDI = .Range("A:A").find(What:=Format(AI, "dd/mm/yyyy"), LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)      
End With`


Range(RngDI.Offset(columnOffset:=3), "D2").Select
    
    
Range("Q10").Formula = "=AVERAGE()"`

What I would like to do is set this range

Range(RngDI.Offset(columnOffset:=3), "D2").Select

as an argument for the AVG function.

Can someone help me? Thanks!

BigBen
  • 46,229
  • 7
  • 24
  • 40
baloobb
  • 11
  • 2

0 Answers0