heperlink cell and cell content

  • Thread starter TUNGANA KURMA RAJU
  • Start date
T

TUNGANA KURMA RAJU

I am looking for a function or proceedure to link cell and its contents in a
worksheet?. For example:
in Sheet1 :
A1=blank
B1=Mango
B2=apple
B3=50
B4=XYZ
I want to hyperlink cells B1 to B4 to Cell A1.When I select B1,cursor should
move to cell A1 with value 'Mango',and if I select B3, cell A1 should
display 50.
Any body from this forum suggest me a function !!!
 
T

TUNGANA KURMA RAJU

thanks, my basic need is i have a webquery in A1 based on a macro.Instead of
selecting from datavalidation list in A1 i would like to automise it by
selecting the parameter 'word' from the list in Column B.
 
G

Gary''s Student

In B1 insert a hyperlink to B1 and make the Text to Display be Mango
In B2 insert a hyperlink to B2 and make the Text to Display be apple
In B3 insert a hyperlink to B3 and make the Text to Display be 50
In B3 insert a hyperlink to B4 and make the Text to Display be XYZ

If any of these cells are clicked, nothing happens since they jump to
themselves.

Now in the worksheet event code area insert the following event macro:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Range("A1").Value = Target.Name
End Sub

Now if B1 thru B4 are clicked, they value in A1 gets established.


Because it is worksheet code, it is very easy to install and automatic to use:

1. right-click the tab name near the bottom of the Excel window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you have any concerns, first try it on a trial worksheet.

If you save the workbook, the macro will be saved with it.


To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm
 
T

TUNGANA KURMA RAJU

Many thanks, you are really a genius.My task beautifully automised.you are
not Gary's student, you are Raju's teacher.
 

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