Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Formula string OK, formula not OK

Please, anybody, donīt you know why this does not work for me?

ActiveCell.formula = "=hyperlink(" & """" & "#'" & Sheets(1).Name &
"'!D" & "1" & """" & ";" & """" & Sheets(1).Name & """" & ")"

Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Formula string OK, formula not OK

This works for me

ActiveCell.Formula = "=HYPERLINK(""#" & Sheets(1).Name & _
"!D1"";""" & Sheets(1).Name & """)"


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Roman" wrote in message
oups.com...
Please, anybody, donīt you know why this does not work for me?

ActiveCell.formula = "=hyperlink(" & """" & "#'" & Sheets(1).Name &
"'!D" & "1" & """" & ";" & """" & Sheets(1).Name & """" & ")"

Thanks in advance.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Formula string OK, formula not OK

Does not for me... shhh... But thank you anyway.

I am always geeting 'Application defined or object defined error'
Any idea?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Formula string OK, formula not OK

When I do this:

activecell.value = "HYPERLINK(""#" & Sheets(1).Name & _
"!D1"";""" & Sheets(1).Name & """)"

and then manually replace "hyper" by "=hyper" it works...

When I do the same progrmatically I get 'The formula you typed contain
error'


Very confused.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Formula string OK, formula not OK

I replaced the comma in my working solution with a ; as you had originally
used that, I assumed that was your setting. Perhaps you need comma also, try

ActiveCell.Formula = "=HYPERLINK(""#" & Sheets(1).Name & _
"!D1"",""" & Sheets(1).Name & """)"


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Roman" wrote in message
oups.com...
Does not for me... shhh... But thank you anyway.

I am always geeting 'Application defined or object defined error'
Any idea?





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Formula string OK, formula not OK

That is it! Thank you much.

Now I see, that when using VBA to create formula I have to put comma
instead ;
which I use when inserting worksheet function manually

Thanks again.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Formula string OK, formula not OK

Of course, even if you are using a setting, VBA works in US format, so you
put a comma, and it will automatically translate to your settings.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Roman" wrote in message
ups.com...
That is it! Thank you much.

Now I see, that when using VBA to create formula I have to put comma
instead ;
which I use when inserting worksheet function manually

Thanks again.



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Formula string OK, formula not OK

If your worksheet has a space in it, then you might want:

ActiveCell.Formula = "=HYPERLINK(""#" & "'" & Sheets(1).Name & "'" & _
"!D1"",""" & Sheets(1).Name & """)"

Those apostrophes won't hurt if they're not needed, but may be required.

Roman wrote:

That is it! Thank you much.

Now I see, that when using VBA to create formula I have to put comma
instead ;
which I use when inserting worksheet function manually

Thanks again.


--

Dave Peterson
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
String Formula James Excel Worksheet Functions 8 October 8th 09 06:40 AM
IF formula string Taylor Excel Worksheet Functions 2 June 19th 08 04:50 PM
Converting a Formula stored as String to real Formula BlueD Excel Worksheet Functions 3 January 14th 08 07:48 PM
Formula to Replace or eliminate any sheetname(s) in formula string EagleOne Excel Discussion (Misc queries) 0 September 20th 06 06:36 PM
Create a formula into a String then assign string to a cell Myrna Larson[_2_] Excel Programming 6 August 23rd 03 09:42 PM


All times are GMT +1. The time now is 09:05 AM.

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

About Us

"It's about Microsoft Excel"