Re: Conditional Hyperlink?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: JulieD (JulieD_at_hctsReMoVeThIs.net.au)
Date: 01/31/05


Date: Mon, 31 Jan 2005 23:40:16 +0800

Hi

AFAIK you'll need to use code to achive this, e.g.

---
Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
On Error GoTo err_Handler
    If Target.Address = "$A$1" And Target.Value = 1 Then
        Range("B1").Select
        ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", 
SubAddress:="KP", TextToDisplay:="KP"
    Else
        Range("B1").Value = ""
    End If
err_Handler:
    Application.EnableEvents = True
End Sub
----
to use the code, right mouse click on the sheet you want to run it against, 
choose view code
and copy & paste the above in - if you have any red lines, go to the end of 
the first one and press delete - this should overcome any wordwrap problems.
Hope this helps
Cheers
JuileD
<mas_it_2000@yahoo.com> wrote in message 
news:1107176510.278869.262340@f14g2000cwb.googlegroups.com...
> Hi everyone,
>
> I want to do thing like this: If A1=1, then hyperlink B2 and KP (where
> kp is a Name Box that exist somewhere in the workbook), otherwise leave
> B2 blank.
>
> How can I do so?
>
> Regards,
> Mike
> 


Relevant Pages

  • Re: Data Validation Problem Work-Around needed
    ... On Error GoTo ws_exit ... Private Sub CheckUsed(ByVal Target As Range, ByVal Col1 As Long, ByVal Col2 ... Dim cellLink As Boolean ...
    (microsoft.public.excel.misc)
  • Re: HOW TO MIX TWO MACRO CODES
    ... Private Sub Worksheet_Change(ByVal Target As Range) ... On Error GoTo ws_exit ... MsgBox "ZERO BUDGET IN AGRESSO", vbInformation, ... "Private Sub Worksheet_Change". ...
    (microsoft.public.excel.programming)
  • Re: How to display formula instead value?
    ... Private Sub Worksheet_change(ByVal Target As Range) ... On Error GoTo ws_exit: ... If .HasFormula Then ...
    (microsoft.public.excel)
  • Re: Data Validation Problem Work-Around needed
    ... On Error GoTo ws_exit ... Private Sub CheckUsed(ByVal Target As Range, ByVal Col1 As Long, ByVal Col2 ... Dim cellLink As Boolean ...
    (microsoft.public.excel.misc)
  • Re: range color formatting
    ... Private Sub Worksheet_Change(ByVal Target As Range) ... On Error GoTo ws_exit: ... "Tom Ogilvy" wrote: ...
    (microsoft.public.excel.programming)