Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Data Validation/Lookup function does function correcty | Excel Worksheet Functions | |||
copy of excel file not showing formulal/function in the function b | Excel Discussion (Misc queries) | |||
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) | Excel Worksheet Functions | |||
Emulate Index/Match combo function w/ VBA custom function | Excel Worksheet Functions | |||
User-Defined Function pre-empting Built-in Function? How to undo???? | Excel Programming |