Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   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.

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.


  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Help in macro in excel.

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.




  #3   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 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.






  #4   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Help in macro in excel.

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.








  #5   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.

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.












  #6   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Help in macro in excel.

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.












Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
Macro 'Automation error' with ChemOffice Excel macro Stew Excel Programming 0 October 27th 03 08:26 PM


All times are GMT +1. The time now is 06:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"