View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
imej-clavier imej-clavier is offline
external usenet poster
 
Posts: 2
Default Formula in a cell (in Visual Basic)

Can somebody understand why my program does not work ?
I have tried to put Cells, :, and so on but it does not work.
Private Sub Moy()
Dim Line As Integer
Line = 16
While Worksheets(1).Cells(Line, 13).Value < ""
Worksheets(1).Cells(Line, 16).Formula =
"=Average(Cells((Line,13),(Line,15)))"
Line = Line + 1
Wend
End Sub
Thank you in advance for the answer,

Jean-michel