ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Circular reference (https://www.excelbanter.com/excel-programming/274233-circular-reference.html)

Chee-wooi Ten

Circular reference
 
I am looking for something that the value to refer its
own. Say B1 originally with the value of 20. Now I want to
use the lookup table to find out the 20 that is "abc" that
write back to its own cell. Is this something possible?

Chee-wooi

steve

Circular reference
 
If you are saying that a value is entered into B1 and than you want the
program to lookup a new value for B1.

Use a Worksheet_Change event. Be sure to put the code in the sheet module
(not a standard module).

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim x
' I am not defining the type of variable because I don't know what you
' are using. Also it allows you to use mixed types.

x = Target.Value ' remove .Value if you have an error
Target.Value = Vlookup(x,"Your Table",2)
' I am assuming a 2 column table

End Sub

steve
Note: code not tested...

"Chee-wooi Ten" wrote in message
...
I am looking for something that the value to refer its
own. Say B1 originally with the value of 20. Now I want to
use the lookup table to find out the 20 that is "abc" that
write back to its own cell. Is this something possible?

Chee-wooi




steve

Circular reference
 
You can only replace the cell contents with a macro. You could create a
formula in another cell to evaluate to the desired value.

steve

p.s.
Please reply to the sent messages so that each message contains all the
previous messages. Otherwise it is difficult to follow the train.

"Chee-wooi Ten" wrote in message
...
Can it be done without writing a macro?

Regards,
cw

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!





All times are GMT +1. The time now is 04:16 PM.

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