ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Controlling a cell in a worksheet (https://www.excelbanter.com/excel-programming/303046-controlling-cell-worksheet.html)

Michael Singmin

Controlling a cell in a worksheet
 
Hello group,

This time, going from VBA to the worksheet.

In the cell F13 is $C$6
Range(Range("F13")) = "Lotus" results in C6 getting the value Lotus

Can this be done in a worksheet ?
Can one put in A1 some code that will do the same ?

Thanks,

Michael Singmin


Juan Pablo González

Controlling a cell in a worksheet
 
No, a function can only return a value, not modify "other" cells, except
itself...

--
Regards

Juan Pablo González

"Michael Singmin" wrote in message
...
Hello group,

This time, going from VBA to the worksheet.

In the cell F13 is $C$6
Range(Range("F13")) = "Lotus" results in C6 getting the value Lotus

Can this be done in a worksheet ?
Can one put in A1 some code that will do the same ?

Thanks,

Michael Singmin




keepITcool

Controlling a cell in a worksheet
 
I think OP measn something different.

cell a1 contains the string "c6"
cell c6 contains "Lotus"

formula =indirect(a1) will result in "Lotus"


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Juan Pablo González" wrote:

No, a function can only return a value, not modify "other" cells, except
itself...



Juan Pablo González

Controlling a cell in a worksheet
 
Mhm... maybe, but the VBA code puts "Lotus" in C6..., hence my comment.
(Unless the OP puts ="Lotus" in C6 <g )

--
Regards

Juan Pablo González

"keepITcool" wrote in message
...
I think OP measn something different.

cell a1 contains the string "c6"
cell c6 contains "Lotus"

formula =indirect(a1) will result in "Lotus"


keepITcool




keepITcool

Controlling a cell in a worksheet
 
oops :) just saw the Range(Range() construct...
and was misled by the OP's phrase 'results in C6 getting'

to OP:
it's like Juan says... 'it can pull but it cant push'




keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Juan Pablo González" wrote:

Mhm... maybe, but the VBA code puts "Lotus" in C6..., hence my comment.
(Unless the OP puts ="Lotus" in C6 <g )



Michael Singmin

Controlling a cell in a worksheet
 
Thank you for the discussion,

I like the rule: Pull but not Push

Btw, John Walkenbach proves otherwise for special cases.
http://j-walk.com/ss/excel/odd/odd06.htm

Cheers,

Michael Singmin
================================================== =====

keepITcool wrote:

oops :) just saw the Range(Range() construct...
and was misled by the OP's phrase 'results in C6 getting'

to OP:
it's like Juan says... 'it can pull but it cant push'




keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Juan Pablo González" wrote:

Mhm... maybe, but the VBA code puts "Lotus" in C6..., hence my comment.
(Unless the OP puts ="Lotus" in C6 <g )




All times are GMT +1. The time now is 12:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com