Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default VB: inserting text into a cell (excel 03)

the following snippet of code does not work becaus the equal sign
within the quotes creates an error.
If i precede the equal sign with an apostrophe, the apostrophe is
inserted into the cell, causinng the formula to be interpreted as
text..

Sheets("Caseload").Range(sel$).Value = "=Hyperlink(http://
www.dc.state.fl.us/InmateReleases/list.asp?DataAction=Filter&dcnumber="
& Range("L3").Value & "," &
Application.WorksheetFunction.Proper(Range("b3").V alue) & ")"

Is there a more elegant way of pasting a value, and making it a
hyperlink? I don't really need to have a formula in the cell if the
VB script can create the hyperlink.

Pardon my poor terminology (self-taught)

--Todd
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default VB: inserting text into a cell (excel 03)

It's not the equal sign that's causing the trouble. You're missing the double
quotes that surround the link address.

The formula would look like:
=hyperlink("http://www.microsoft.com")

So

Sheets("Caseload").Range(sel$).Formula = "=Hyperlink(""http://" _
& "www.dc.state.fl.us/InmateReleases/list.asp?DataAction=Filter&dcnumber=" _
& Range("L3").Value & "," _
& Application.WorksheetFunction.Proper(Range("b3").V alue) & """)"

ps. I changed the .value to .formula since it's a formula.

pps. When you need a double quote in a string, you have to double them up in
your code.

Jabberwocky wrote:

the following snippet of code does not work becaus the equal sign
within the quotes creates an error.
If i precede the equal sign with an apostrophe, the apostrophe is
inserted into the cell, causinng the formula to be interpreted as
text..

Sheets("Caseload").Range(sel$).Value = "=Hyperlink(http://
www.dc.state.fl.us/InmateReleases/list.asp?DataAction=Filter&dcnumber="
& Range("L3").Value & "," &
Application.WorksheetFunction.Proper(Range("b3").V alue) & ")"

Is there a more elegant way of pasting a value, and making it a
hyperlink? I don't really need to have a formula in the cell if the
VB script can create the hyperlink.

Pardon my poor terminology (self-taught)

--Todd


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default VB: inserting text into a cell (excel 03)

Thanks. That did the trick. Do you know a way to make it a
hyperlinked text rather than a formula?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default VB: inserting text into a cell (excel 03)

On Aug 4, 11:35*am, Jabberwocky
wrote:
Thanks. *That did the trick. *Do you know a way to make it a
hyperlinked text rather than a formula?


Answering my own question:

Sheets("Caseload").Range(sel$).Hyperlinks.add
Anchor:=Sheets("Caseload").Range(sel$), Address:="http://
www.dc.state.fl.us/ActiveInmates/list.asp?DataAction=Filter&dcnumber="
_
& Range("L3").Value,
TextToDisplay:=Application.WorksheetFunction.Prope r(Range("b3").Value)
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 - Inserting text to a cell already containg text Dileep Chandran Excel Worksheet Functions 5 December 7th 06 03:42 PM
Macro - Inserting text to a cell already containg text Dileep Chandran Excel Discussion (Misc queries) 6 December 7th 06 03:42 PM
Inserting text from a cell in another tab Karen Smith Excel Discussion (Misc queries) 2 October 4th 06 06:16 PM
Inserting text within a cell Hayley Excel Discussion (Misc queries) 6 October 28th 05 10:36 PM
Automatically inserting text into a cell Roy Excel Discussion (Misc queries) 2 June 17th 05 01:56 PM


All times are GMT +1. The time now is 05:27 PM.

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"