Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Put a Formula into a Cell with Index

What I want to do is :
to put a Formula into a Cell in running time

'KK is the index from the Sheet1
'FacInd other Sheet
'Sheet2 where the Cell Formula I want to put

KK = i + 2
Worksheets("Sheet2").Cells(iRow, 5).Formula = "=(Sheet1!$(KK,4) * FacInd!$E47
* FacInd!$E93)"
but this part (Sheet1!$(KK,4) does not works
I dont know if the syntaxes is correct? Because send a error (application-
defined or object defined error ) some thing like that.
also I have tried with a ListBox :
Worksheets("Sheet2").Cells(iRow, 5).Formula = "=(Sheet1!$(KK,4) * FacInd!$E47
* FacInd!$E93)"

just to mention as value I can get into the cell but as Formula I can not



Please I need Help to solve this

Alberto

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200601/1
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Put a Formula into a Cell with Index

It would have to be something like

Worksheets("Sheet2").Cells(iRow, 5).Formula = "=(Sheet1!$K4) * FacInd!$E47
* FacInd!$E93)"

I am unclear as to what cell on Sheet1 you are addressing. Is the value in
KK supposed to be the column number, and 4 the row number, vice versa, or
what?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"alberto via OfficeKB.com" <u17340@uwe wrote in message
news:5a05461e1d66b@uwe...
What I want to do is :
to put a Formula into a Cell in running time

'KK is the index from the Sheet1
'FacInd other Sheet
'Sheet2 where the Cell Formula I want to put

KK = i + 2
Worksheets("Sheet2").Cells(iRow, 5).Formula = "=(Sheet1!$(KK,4) *

FacInd!$E47
* FacInd!$E93)"
but this part (Sheet1!$(KK,4) does not works
I dont know if the syntaxes is correct? Because send a error

(application-
defined or object defined error ) some thing like that.
also I have tried with a ListBox :
Worksheets("Sheet2").Cells(iRow, 5).Formula = "=(Sheet1!$(KK,4) *

FacInd!$E47
* FacInd!$E93)"

just to mention as value I can get into the cell but as Formula I can not



Please I need Help to solve this

Alberto

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200601/1



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Put a Formula into a Cell with Index

yes, the KK is the row the Column is 4 and the Cell Formula will be in the
Sheet2:
but KK is selected in running time by ListBox index


Thank you Bob

Alberto

Bob Phillips wrote:
It would have to be something like

Worksheets("Sheet2").Cells(iRow, 5).Formula = "=(Sheet1!$K4) * FacInd!$E47
* FacInd!$E93)"

I am unclear as to what cell on Sheet1 you are addressing. Is the value in
KK supposed to be the column number, and 4 the row number, vice versa, or
what?

What I want to do is :
to put a Formula into a Cell in running time

[quoted text clipped - 18 lines]

Alberto


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200601/1
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Put a Formula into a Cell with Index

Worksheets("Sheet2").Cells(iRow, 5).Formula = "=Sheet1!$D" & kk & _
"* FacInd!$E47* FacInd!$E93"

--
Regards,
Tom Ogilvy


"alberto via OfficeKB.com" <u17340@uwe wrote in message
news:5a059bf6818c7@uwe...
yes, the KK is the row the Column is 4 and the Cell Formula will be in the
Sheet2:
but KK is selected in running time by ListBox index


Thank you Bob

Alberto

Bob Phillips wrote:
It would have to be something like

Worksheets("Sheet2").Cells(iRow, 5).Formula = "=(Sheet1!$K4) *

FacInd!$E47
* FacInd!$E93)"

I am unclear as to what cell on Sheet1 you are addressing. Is the value

in
KK supposed to be the column number, and 4 the row number, vice versa, or
what?

What I want to do is :
to put a Formula into a Cell in running time

[quoted text clipped - 18 lines]

Alberto


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200601/1



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Put a Formula into a Cell with Index

Does not works, I tried in this way,....
KK its not a colum KK can take any row number, the column is number 4.

thank you
Alberto

Tom Ogilvy wrote:
Worksheets("Sheet2").Cells(iRow, 5).Formula = "=Sheet1!$D" & kk & _
"* FacInd!$E47* FacInd!$E93"

yes, the KK is the row the Column is 4 and the Cell Formula will be in the
Sheet2:

[quoted text clipped - 18 lines]

Alberto


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200601/1


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Put a Formula into a Cell with Index

That is what Tom gave you, he hardcoded a column of 'D'.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"alberto via OfficeKB.com" <u17340@uwe wrote in message
news:5a0deef67f941@uwe...
Does not works, I tried in this way,....
KK its not a colum KK can take any row number, the column is number 4.

thank you
Alberto

Tom Ogilvy wrote:
Worksheets("Sheet2").Cells(iRow, 5).Formula = "=Sheet1!$D" & kk & _
"* FacInd!$E47* FacInd!$E93"

yes, the KK is the row the Column is 4 and the Cell Formula will be in

the
Sheet2:

[quoted text clipped - 18 lines]

Alberto


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200601/1



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Put a Formula into a Cell with Index

I am sorry English is not my language I do not understand the term
<<hardcoded a colums of 'D'

could you please explain me

thank you
Alberto

Bob Phillips wrote:
That is what Tom gave you, he hardcoded a column of 'D'.

Does not works, I tried in this way,....
KK its not a colum KK can take any row number, the column is number 4.

[quoted text clipped - 10 lines]

Alberto


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200601/1
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Put a Formula into a Cell with Index

Tom gave you

Worksheets("Sheet2").Cells(iRow, 5).Formula = "=Sheet1!$D" & kk & _
"* FacInd!$E47* FacInd!$E93"

In this the column, D, is explicitly stated, it is not dependent on any
variable, whereas the row is a variable KK. So if KK is 4, this is
equivalent to putting the formula

=Sheet1!$D4* FacInd!$E47* FacInd!$E93

in that cell. This appears to be what you asked for.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"alberto via OfficeKB.com" <u17340@uwe wrote in message
news:5a0f975dd170d@uwe...
I am sorry English is not my language I do not understand the term
<<hardcoded a colums of 'D'

could you please explain me

thank you
Alberto

Bob Phillips wrote:
That is what Tom gave you, he hardcoded a column of 'D'.

Does not works, I tried in this way,....
KK its not a colum KK can take any row number, the column is number 4.

[quoted text clipped - 10 lines]

Alberto


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200601/1



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Put a Formula into a Cell with Index

Thnak you all of you Tom and Bob you have pretty good understanding of Excel
you help me too much!
I do appreciate all your help, could suggest me any refference where to study
or where to see that kind of knowledge,
once again , thank you very much

Alberto

Bob Phillips wrote:
Tom gave you

Worksheets("Sheet2").Cells(iRow, 5).Formula = "=Sheet1!$D" & kk & _
"* FacInd!$E47* FacInd!$E93"

In this the column, D, is explicitly stated, it is not dependent on any
variable, whereas the row is a variable KK. So if KK is 4, this is
equivalent to putting the formula

=Sheet1!$D4* FacInd!$E47* FacInd!$E93

in that cell. This appears to be what you asked for.

I am sorry English is not my language I do not understand the term
<<hardcoded a colums of 'D'

[quoted text clipped - 11 lines]

Alberto


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200601/1
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
Changing part of cell reference in INDEX - MATCH formula HebbeLille Excel Worksheet Functions 7 August 6th 09 02:53 PM
Cell color index formula reference instead of =counta Mr. m0le[_2_] Excel Discussion (Misc queries) 0 July 30th 09 02:13 AM
Index formula-change cell range Wilma Excel Worksheet Functions 2 July 15th 09 09:06 PM
Index Formula Cow Girl Excel Worksheet Functions 9 June 30th 09 06:45 PM
Using the contents of a cell as a file name for an INDEX formula Michael Excel Discussion (Misc queries) 1 June 30th 08 10:56 PM


All times are GMT +1. The time now is 08:12 PM.

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

About Us

"It's about Microsoft Excel"