View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] donna.gough@hydro.com is offline
external usenet poster
 
Posts: 81
Default How to fill range with formula using VBA?

Try something along these lines.

lcl = Left(Columns(lc).Address(0, 0), 2 + (lc < 27))
MyRange = "E2:" & lcl + "2"
Range("a7") = "=Average(" & MyRange + ")"
Donna