PC Review


Reply
Thread Tools Rate Thread

Cell to display certain if an entry is provided

 
 
Bryan
Guest
Posts: n/a
 
      19th Sep 2008
I have a column in my excel spreadsheet title WWW. It's used to list
hyperlinks to products on a company website. What I would like to do, is
when a user selects the desired cell in this column and hits cntrl+k to enter
a hyperlink, a formula will automatically insert the text 'link' when there
is an entry instead of the entire URL. Is this possible? I looked into
conditional formatting, but I cannot seem to figure out how to do what I want.
 
Reply With Quote
 
 
 
 
Bob Bridges
Guest
Posts: n/a
 
      19th Sep 2008
I don't know much about links in VBA/Excel, but you can set up an event
that's triggered whenever your user changes the contents of a cell; the event
code would check to see whether the cell is this special one, and if it is
could (I presume) do whatever is necessary to turn the entered text into a
link. I thought you could do a KeyPress event to check for <Ctl-K>, but I
don't see that available in the VBA/Excel documentation now that I look --
that is, not for worksheets or cells, though it is for user forms and
controls.

But maybe this simply means the user doesn't have to hit <Ctl-K>; just enter
the data and it works.

--- "Bryan" wrote:
> I have a column in my excel spreadsheet title WWW. It's used to list
> hyperlinks to products on a company website. What I would like to do, is
> when a user selects the desired cell in this column and hits cntrl+k to enter
> a hyperlink, a formula will automatically insert the text 'link' when there
> is an entry instead of the entire URL. Is this possible? I looked into
> conditional formatting, but I cannot seem to figure out how to do what I want.

 
Reply With Quote
 
Bryan
Guest
Posts: n/a
 
      22nd Sep 2008
Bob, thanks for the reply but I still cannot find a way to do what I want.
Hopefully bumping this up a little will result in more idea's. Just to
recap, when a use enters a URL in a cell, I don't want the entire, long, url
to be displayed instead a clickable link entitled 'www'.

"Bob Bridges" wrote:

> I don't know much about links in VBA/Excel, but you can set up an event
> that's triggered whenever your user changes the contents of a cell; the event
> code would check to see whether the cell is this special one, and if it is
> could (I presume) do whatever is necessary to turn the entered text into a
> link. I thought you could do a KeyPress event to check for <Ctl-K>, but I
> don't see that available in the VBA/Excel documentation now that I look --
> that is, not for worksheets or cells, though it is for user forms and
> controls.
>
> But maybe this simply means the user doesn't have to hit <Ctl-K>; just enter
> the data and it works.
>
> --- "Bryan" wrote:
> > I have a column in my excel spreadsheet title WWW. It's used to list
> > hyperlinks to products on a company website. What I would like to do, is
> > when a user selects the desired cell in this column and hits cntrl+k to enter
> > a hyperlink, a formula will automatically insert the text 'link' when there
> > is an entry instead of the entire URL. Is this possible? I looked into
> > conditional formatting, but I cannot seem to figure out how to do what I want.

 
Reply With Quote
 
Bob Bridges
Guest
Posts: n/a
 
      22nd Sep 2008
Right: A user types a URL into any cell in a particular column that you'll
specify, and you want to get Excel automatically to turn the URL into a
clickable link. (What the link displays is a mere detail; once you know how
to create a link, you can make the displayed text ("WWW") and the actual URL
whatever you say they should be.) Here's what you need to know:

1) How to create a link in Excel. I've never done that before, but the Help
file seems clear enough. I expect you already know this part; if not, just
go to Help and enter "create hyperlink" to see the directions on that.

2) How to write a VBA program in general. I've been assuming you already
have this part under your belt; some people come here not knowing even that
(you gotta start somewhere, after all), but most folks here already know this
part. If you don't, this little task of yours actually isn't too bad a place
to start -- but we'll have to go over some fundamentals first or the actual
doing of it won't make any sense to you.

3) How to get a VBA program to run whenever a user changes a cell. For that
it seems to me you need a Worksheet_Change subroutine, which is what I was
referring to below, and my first guess was that this is the part you don't
already know how to do -- but maybe not, based on your reaction.

4) How to code the VBA statements that will create the link that you already
know how to create manually. I haven't tried that yet, but I expect once you
know the first three things, this would fall into place pretty naturally. So
I don't think this is what you're asking.

If you know all of the above four things, it seems to me, then you know how
to do what you're trying to do. Therefore I figure your question is how to
do one or more of the above. Which?

--- "Bryan" wrote:
> Bob, thanks for the reply but I still cannot find a way to do what I want.
> Hopefully bumping this up a little will result in more idea's. Just to
> recap, when a use enters a URL in a cell, I don't want the entire, long, url
> to be displayed instead a clickable link entitled 'www'.
>
> --- "Bob Bridges" wrote:
> > I don't know much about links in VBA/Excel, but you can set up an event
> > that's triggered whenever your user changes the contents of a cell; the event
> > code would check to see whether the cell is this special one, and if it is
> > could (I presume) do whatever is necessary to turn the entered text into a
> > link. I thought you could do a KeyPress event to check for <Ctl-K>, but I
> > don't see that available in the VBA/Excel documentation now that I look --
> > that is, not for worksheets or cells, though it is for user forms and
> > controls.
> >
> > But maybe this simply means the user doesn't have to hit <Ctl-K>; just enter
> > the data and it works.
> >
> > --- "Bryan" wrote:
> > > I have a column in my excel spreadsheet title WWW. It's used to list
> > > hyperlinks to products on a company website. What I would like to do, is
> > > when a user selects the desired cell in this column and hits cntrl+k to enter
> > > a hyperlink, a formula will automatically insert the text 'link' when there
> > > is an entry instead of the entire URL. Is this possible? I looked into
> > > conditional formatting, but I cannot seem to figure out...

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to display a cell value as a text entry in another cell? StargateFanNotAtHome Microsoft Excel Discussion 4 31st Jul 2009 11:02 AM
to Don: display last entry to cell automatically mike CBA Microsoft Excel Worksheet Functions 6 15th Feb 2009 07:04 PM
display last entry into a cell automatically mike CBA Microsoft Excel Worksheet Functions 2 15th Feb 2009 04:26 PM
How do i have a check display with any data entry in a cell =?Utf-8?B?andvbWFjaw==?= Microsoft Excel Misc 8 19th Nov 2005 12:27 AM
Count cells provided another cell has a particular entry Wicks Microsoft Excel Worksheet Functions 1 8th Oct 2004 05:53 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:08 PM.