View Single Post
  #8   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
SPG SPG is offline
external usenet poster
 
Posts: 5
Default Help in macro in excel.

Thanks a ton Earl :-)


"Earl Kiosterud" wrote in message
...
SPG,

I forgot to mention. The macro doesn't have to be in the workbook with
either the linked cell or the target cell. It just has to be in an open
workbook. The linked cell can be in a different sheet from the target

cell,
and even in a different workbook.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Earl Kiosterud" wrote in message
...
SPG,

Paste this into a module:

Sub PutLink()
ActiveSheet.Paste Link:=True
End Sub

Now select the cell to which another cell is to be linked, and Copy.

Then
select the cell to be linked to it, and run the macro. You may want to
assign the macro to a keyboard shortcut, like Ctrl-Shift-L.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"SPG" wrote in message
...
Hi Earl,
I want a macro to do it.
Please suggest.
Thanks a ton !



"Earl Kiosterud" wrote in message
...
SPG,

Do you want to make links manually? Or do you want a macro to do

it?

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"SPG" wrote in message
...
Thanks for the response Earl.
Need a little more help.
Can't I get teh normal link instead of the hyperlink to link data

in
two
workbooks of my same worksheets?


"Earl Kiosterud" wrote in message
...
SPG,

Running the macro recorder whilst inserting a hyperlink yields

this
code:

ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="",
SubAddress:=
_
"Sheet1!A1", TextToDisplay:="""go to hell"""

Now just substitute the relevant stuff into each parameter. It

might
look
like

ActiveSheet.Hyperlinks.Add
Anchor:=Workbooks("Book4.xls").Sheets("Sheet1").Ra nge("C2"),
Address:="",
SubAddress:= _
"[book3.xls]Sheet1!A2", TextToDisplay:="""go here"""

This puts a link in book4, sheet1, C2, and it links to book3,

sheet1,
A2,
and the link says "go here."
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"SPG" wrote in message
...
Hi all.
I want to write a macro in an excel sheet wherein I want to

copy
a
few
cells
from my source worksheet and paste their hyperlink to another
worksheet.
Also, the destination worksheet's cell number where this is

pasted
is
not
fixed. How do I accomplish this?
Please help urgently.
Thanks.