Circular reference

C

Chee-wooi Ten

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
 
S

steve

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...
 
S

steve

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top