Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default function help

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




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default function help

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






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default function help

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








  #4   Report Post  
Posted to microsoft.public.excel.programming
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










  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default function help

Some added thoughts.

What error are you getting.

is row a number between 1 and 65536
is col a number between 1 and 256 or a single letter between a and z or a
double letter between AA and IV
Is SheetDestination a string variable having a value that corresponds to an
existing sheet name. Is that Sheet a worksheet?

--
Regards,
Tom Ogilvy


"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








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Data Validation/Lookup function does function correcty Kirkey Excel Worksheet Functions 2 May 25th 09 09:22 PM
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
User-Defined Function pre-empting Built-in Function? How to undo???? MarWun Excel Programming 1 August 6th 03 09:31 PM


All times are GMT +1. The time now is 06:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"