Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
Macro 'Automation error' with ChemOffice Excel macro | Excel Programming |