Complex Hyperlink Function

cmeier7

Board Regular
Joined
Jul 23, 2009
Messages
64
Hi, in VBA I have

Code:
Sheets("" & tab_name & "").Cells(1, 2) = "=HYPERLINK("""" & 'Sheet1'!A2 & ""'Sheet1'!A1"""",""To Main Roll-Up"")"

tab_name is a defined variable.
The code inserts an equation containing a hyperlink function. In 'Sheet1'!A2, I have the current workbook name (ie [Book1]). I believe there is an issue with all of the quotations. Can anyone figure out this puzzle? I've been at it for a while with no luck.

Oh, btw, I get error message '1004' - Application-defined or object-defined error
 
Last edited:
Ok, for clarification purposes, I want VBA to put this formula (below) into the specific cell. The below formula works. I have the workbook name in Cell A2 of Sheet1. I am wanting to place the hyperlink into Cell C1 of " & tab_name & " which is a String defined variable and changes with every loop in my code.

Sheets(tab_name).Cells(1,3)=HYPERLINK("" & 'Sheet1'!A2 & "'Sheet2'!A1", "To Reachback")
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
I'm sorry, the forum froze for me before I could edit my post and formula. Disreguard the previous 2 posts.
_______________________________________________________________________________________


Ok, for clarification purposes, I want VBA to put this formula (below) into the specific cell. The below formula works. I have the workbook name in Cell A2 of Sheet1. I am wanting to place the hyperlink into Cell C1 of " & tab_name & " which is a String defined variable and changes with every loop in my code.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
Formula in Cell C1-
<o:p></o:p>
<o:p></o:p>
=HYPERLINK("" & 'Sheet1'!A2 & "'Sheet2'!A1", "To Reachback")<o:p></o:p>
 
Upvote 0

Forum statistics

Threads
1,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top