#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Link code

I would like to place code in a Module, or ThisWorkbook,
that would highlight cells with links to other places.
Something like a conditional format. It should be
something I can turn on, look at the cells, then turn off -
don't want the highlighting permanent. What code would do
this, and where would I put it?

Thanks, Phil
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Link code

Phil,

One way:

Place this in the sheet module:


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Union(Range("a1"), Range("e1"), Range("h1")).Select
With Selection
If .Interior.ColorIndex = xlNone Then
.Interior.ColorIndex = 6
Else
.Interior.ColorIndex = xlNone
End If
End With
End Sub

Assuming that the linked cells are A1, E1, and H1 (change to your linked
cells), each time you double click on this sheet, the linked cells will turn
yellow. Double click again and they go back to no color.

Don Pistulka


"Phil Hageman" wrote in message
...
I would like to place code in a Module, or ThisWorkbook,
that would highlight cells with links to other places.
Something like a conditional format. It should be
something I can turn on, look at the cells, then turn off -
don't want the highlighting permanent. What code would do
this, and where would I put it?

Thanks, Phil



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Link code


Phil,

From the Control ToolBox put a ToggleButton on your sheet.

Click the Design Mode button to made the togglebutton work.

Add this code to the sheet module.

Private Sub ToggleButton1_Click()
Union(Range("a1"), Range("e1"), Range("h1")).Select
With Selection
If .Interior.ColorIndex = xlNone Then
.Interior.ColorIndex = 6
Else
.Interior.ColorIndex = xlNone
End If
End With
End Sub

Don Pistulka


"Phil Hageman" wrote in message
...
Don, Thanks for taking the time to answer my thread. Just
as I clicked to send this thread, I thought how useful
this could be if used as a macro, with a button/buttons on
the menu bar to execute the highlight. How could I do
this?


-----Original Message-----
Phil,

One way:

Place this in the sheet module:


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As

Range, Cancel As
Boolean)
Union(Range("a1"), Range("e1"), Range("h1")).Select
With Selection
If .Interior.ColorIndex = xlNone Then
.Interior.ColorIndex = 6
Else
.Interior.ColorIndex = xlNone
End If
End With
End Sub

Assuming that the linked cells are A1, E1, and H1 (change

to your linked
cells), each time you double click on this sheet, the

linked cells will turn
yellow. Double click again and they go back to no color.

Don Pistulka


"Phil Hageman" wrote in message
...
I would like to place code in a Module, or ThisWorkbook,
that would highlight cells with links to other places.
Something like a conditional format. It should be
something I can turn on, look at the cells, then turn

off -
don't want the highlighting permanent. What code would

do
this, and where would I put it?

Thanks, Phil



.



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
VB Code to link to website EA Excel Worksheet Functions 1 October 3rd 07 09:15 PM
VB Code to link to website EA Excel Discussion (Misc queries) 1 October 3rd 07 08:04 PM
EVEN AFTER PUTTING CODE IN VB, THE MESSAGE 'WORKBOOK CONTAINS LINK' POPS UP- HOW TO GET OVER THIS CAPTGNVR Excel Discussion (Misc queries) 3 February 3rd 07 08:46 PM
Changing the code on an external link. sungen99 Excel Discussion (Misc queries) 1 May 25th 06 03:30 PM
how do i insert a code bar or link to a adobe designer file Luis Arechiga Excel Worksheet Functions 1 December 19th 05 02:10 AM


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

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"