Thread: function help
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
NickHK[_2_] NickHK[_2_] is offline
external usenet poster
 
Posts: 29
Default function help

Mike,
Is there any point using .Formula when all your values are numbers not
refences ?

Also, doesn't your formaul boil down to:
[Destination].Formula = ValeurNational

Add a Debug.Print ValEnt, after ValEnt assignment to see what value you are
using.

It doesn't look like you are declaring your variable either.

NickHK

"Mike VB" wrote in message
...
Hi

this my source code

FeuilleSource = "feuil1"
FeuilleDestination = "feuil2"

firstCol = 2
lastCol = 4
ColonneNational = 5

firstrow = 2
DerniereLigne = 100

For colonne = firstCol To lastCol
ValEnt = ""
For ligne = firstrow To DerniereLigne
If Sheets(FeuilleSource).Cells(ligne, colonne).Value < "" Then
If ValEnt = "" Then
ValEnt = Sheets(FeuilleSource).Cells(ligne, colonne).Value
ValeurNational = Sheets(FeuilleSource).Cells(ligne,
ColonneNational).Value
End If
Sheets(FeuilleDestination).Cells(ligne, colonne).Formula = _
"=(" & Sheets(FeuilleSource).Cells(ligne, colonne).Value & _
"*" & ValeurNational & ") / " & ValEnt
End If
Next ligne
Next colonne


Best regards,
Mike


"NickHK" a écrit dans le message de
...
Mike,
Is ValEnt supposed to a number ?
What is it declared as ?

NickHK

"Mike VB" wrote in message
...
Hello
I've an error:

Sheets(SheetDestination).Cells(row, col).Formula =
"=(19981,1882918624*452)/19981,1882918624"

En fait ma ligne de code exact est:
Sheets(SheetDestination).Cells(row, col).Formula = _
"=(" & Sheets(SheetSource).Cells(row, col).Value & _
"*" & Base & ") / " & ValEnt


Regrads