View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default heperlink cell and cell content

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





--
Gary''s Student - gsnu200783


"TUNGANA KURMA RAJU" wrote:

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.

"Gary''s Student" wrote:

The usualy method is to use a Data Validation pull-down list. When you click
on the empty A1 cell, all the options in column B appear and a single click
will fill cell A1.

See:

http://www.contextures.com/xlDataVal01.html
--
Gary''s Student - gsnu200783


"TUNGANA KURMA RAJU" wrote:

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 !!!