Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Active cell with a "crosshair" indicator ?

Hi, could anybody please help -
if I put the cursor on an active cell on a spreadsheet, I want the
corresponding row and column being highlighted (i.e. like a crosshair) - how
do I do that ?

appreciate your answer,
thanks
Karen
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,069
Default Active cell with a "crosshair" indicator ?

Here is one way to do that - including a way to turn the highlighting on or
off. In the code module for each worksheet where you want this to happen,
paste this code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call HiliteCells(Target)
End Sub

In a VBA module in the same workbook, paste this code:

Public NotNow As Boolean

Public Sub HiliteOn()
NotNow = False
End Sub

Public Sub HiliteOff()
NotNow = True
Cells.Interior.ColorIndex = xlColorIndexNone
End Sub

Public Sub HiliteCells(Target As Range)
If NotNow = False Then
Cells.Interior.ColorIndex = xlColorIndexNone
Target.EntireRow.Interior.ColorIndex = 36
Target.EntireColumn.Interior.ColorIndex = 36
End If
End Sub

(ColorIndex 36 is light yellow. Change to whatever you like).

To start highlighting on that worksheet, run the HiliteOn macro. To stop it,
run the HiliteOff macro. These could be assigned to toolbar buttons.

Hope this helps,

Hutch

"KarenY" wrote:

Hi, could anybody please help -
if I put the cursor on an active cell on a spreadsheet, I want the
corresponding row and column being highlighted (i.e. like a crosshair) - how
do I do that ?

appreciate your answer,
thanks
Karen

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Active cell with a "crosshair" indicator ?

Thanks Tom,

When I turned on the Macro.
I got "Compile error - Sub or Function not defined".
The "Call HiliteCells" was highlighted for this Compiled error in the
worksheet ?

What shall I do ?

karen

"Tom Hutchins" wrote:

Here is one way to do that - including a way to turn the highlighting on or
off. In the code module for each worksheet where you want this to happen,
paste this code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call HiliteCells(Target)
End Sub

In a VBA module in the same workbook, paste this code:

Public NotNow As Boolean

Public Sub HiliteOn()
NotNow = False
End Sub

Public Sub HiliteOff()
NotNow = True
Cells.Interior.ColorIndex = xlColorIndexNone
End Sub

Public Sub HiliteCells(Target As Range)
If NotNow = False Then
Cells.Interior.ColorIndex = xlColorIndexNone
Target.EntireRow.Interior.ColorIndex = 36
Target.EntireColumn.Interior.ColorIndex = 36
End If
End Sub

(ColorIndex 36 is light yellow. Change to whatever you like).

To start highlighting on that worksheet, run the HiliteOn macro. To stop it,
run the HiliteOff macro. These could be assigned to toolbar buttons.

Hope this helps,

Hutch

"KarenY" wrote:

Hi, could anybody please help -
if I put the cursor on an active cell on a spreadsheet, I want the
corresponding row and column being highlighted (i.e. like a crosshair) - how
do I do that ?

appreciate your answer,
thanks
Karen

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,069
Default Active cell with a "crosshair" indicator ?

My guess is that you pasted the Public variable and subroutines into the
ThisWorkbook module. That won't work; you have to insert a VBA module. In the
Visual Basic Editor, select Project Explorer from the View menu & make sure
the Project Explorer window is displayed. You should see bold text that says
VBAProject (ABC.xls), where ABC is the name of your workbook. Click the
VBAProject with the name of your workbook, then select Module from the Insert
menu. Paste the code I sent you, starting with "Public NotNow as Boolean",
into the new code module. If you had pasted it into the ThisWorkbook module
earlier, delete it there.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Hutch

"KarenY" wrote:

Thanks Tom,

When I turned on the Macro.
I got "Compile error - Sub or Function not defined".
The "Call HiliteCells" was highlighted for this Compiled error in the
worksheet ?

What shall I do ?

karen

"Tom Hutchins" wrote:

Here is one way to do that - including a way to turn the highlighting on or
off. In the code module for each worksheet where you want this to happen,
paste this code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call HiliteCells(Target)
End Sub

In a VBA module in the same workbook, paste this code:

Public NotNow As Boolean

Public Sub HiliteOn()
NotNow = False
End Sub

Public Sub HiliteOff()
NotNow = True
Cells.Interior.ColorIndex = xlColorIndexNone
End Sub

Public Sub HiliteCells(Target As Range)
If NotNow = False Then
Cells.Interior.ColorIndex = xlColorIndexNone
Target.EntireRow.Interior.ColorIndex = 36
Target.EntireColumn.Interior.ColorIndex = 36
End If
End Sub

(ColorIndex 36 is light yellow. Change to whatever you like).

To start highlighting on that worksheet, run the HiliteOn macro. To stop it,
run the HiliteOff macro. These could be assigned to toolbar buttons.

Hope this helps,

Hutch

"KarenY" wrote:

Hi, could anybody please help -
if I put the cursor on an active cell on a spreadsheet, I want the
corresponding row and column being highlighted (i.e. like a crosshair) - how
do I do that ?

appreciate your answer,
thanks
Karen

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Active cell with a "crosshair" indicator ?

I am familiar with recording and running macro but not with VBA-modules.
I followed your instruction.
I pasted starting with "Public NotNow as Boolean" to the workbook - nothing
happens when I run the "HiteOn".
Then I realized I might have to paste the "Private Sub
Worksheet_SelectionChange(ByVal Target As Range)...etc" to the worksheet, so
I did the "paste" - again, nothing happens when I run the "HiteOn".

I am sorry being "stupid".

thanks
Karen

"Tom Hutchins" wrote:

My guess is that you pasted the Public variable and subroutines into the
ThisWorkbook module. That won't work; you have to insert a VBA module. In the
Visual Basic Editor, select Project Explorer from the View menu & make sure
the Project Explorer window is displayed. You should see bold text that says
VBAProject (ABC.xls), where ABC is the name of your workbook. Click the
VBAProject with the name of your workbook, then select Module from the Insert
menu. Paste the code I sent you, starting with "Public NotNow as Boolean",
into the new code module. If you had pasted it into the ThisWorkbook module
earlier, delete it there.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Hutch

"KarenY" wrote:

Thanks Tom,

When I turned on the Macro.
I got "Compile error - Sub or Function not defined".
The "Call HiliteCells" was highlighted for this Compiled error in the
worksheet ?

What shall I do ?

karen

"Tom Hutchins" wrote:

Here is one way to do that - including a way to turn the highlighting on or
off. In the code module for each worksheet where you want this to happen,
paste this code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call HiliteCells(Target)
End Sub

In a VBA module in the same workbook, paste this code:

Public NotNow As Boolean

Public Sub HiliteOn()
NotNow = False
End Sub

Public Sub HiliteOff()
NotNow = True
Cells.Interior.ColorIndex = xlColorIndexNone
End Sub

Public Sub HiliteCells(Target As Range)
If NotNow = False Then
Cells.Interior.ColorIndex = xlColorIndexNone
Target.EntireRow.Interior.ColorIndex = 36
Target.EntireColumn.Interior.ColorIndex = 36
End If
End Sub

(ColorIndex 36 is light yellow. Change to whatever you like).

To start highlighting on that worksheet, run the HiliteOn macro. To stop it,
run the HiliteOff macro. These could be assigned to toolbar buttons.

Hope this helps,

Hutch

"KarenY" wrote:

Hi, could anybody please help -
if I put the cursor on an active cell on a spreadsheet, I want the
corresponding row and column being highlighted (i.e. like a crosshair) - how
do I do that ?

appreciate your answer,
thanks
Karen



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,069
Default Active cell with a "crosshair" indicator ?

Definitiely, the Visual Basic Editor can be confusing at first. I have
created a small sample workbook with the crosshairs highlighting code set to
work for Sheet1. Here is a link to it:

http://www.freefilehosting.net/download/3dcfb

To have the code work for Sheet2 (for example), copy & paste the same code
in the Sheet1 code page to the Sheet2 code page. If you want the crosshairs
highlighting to work on every sheet in the workbook, comment out the code on
the individual sheets and uncomment the subroutine on the ThisWorkbook code
page.

Hope this helps,

Hutch

"KarenY" wrote:

I am familiar with recording and running macro but not with VBA-modules.
I followed your instruction.
I pasted starting with "Public NotNow as Boolean" to the workbook - nothing
happens when I run the "HiteOn".
Then I realized I might have to paste the "Private Sub
Worksheet_SelectionChange(ByVal Target As Range)...etc" to the worksheet, so
I did the "paste" - again, nothing happens when I run the "HiteOn".

I am sorry being "stupid".

thanks
Karen

"Tom Hutchins" wrote:

My guess is that you pasted the Public variable and subroutines into the
ThisWorkbook module. That won't work; you have to insert a VBA module. In the
Visual Basic Editor, select Project Explorer from the View menu & make sure
the Project Explorer window is displayed. You should see bold text that says
VBAProject (ABC.xls), where ABC is the name of your workbook. Click the
VBAProject with the name of your workbook, then select Module from the Insert
menu. Paste the code I sent you, starting with "Public NotNow as Boolean",
into the new code module. If you had pasted it into the ThisWorkbook module
earlier, delete it there.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Hutch

"KarenY" wrote:

Thanks Tom,

When I turned on the Macro.
I got "Compile error - Sub or Function not defined".
The "Call HiliteCells" was highlighted for this Compiled error in the
worksheet ?

What shall I do ?

karen

"Tom Hutchins" wrote:

Here is one way to do that - including a way to turn the highlighting on or
off. In the code module for each worksheet where you want this to happen,
paste this code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call HiliteCells(Target)
End Sub

In a VBA module in the same workbook, paste this code:

Public NotNow As Boolean

Public Sub HiliteOn()
NotNow = False
End Sub

Public Sub HiliteOff()
NotNow = True
Cells.Interior.ColorIndex = xlColorIndexNone
End Sub

Public Sub HiliteCells(Target As Range)
If NotNow = False Then
Cells.Interior.ColorIndex = xlColorIndexNone
Target.EntireRow.Interior.ColorIndex = 36
Target.EntireColumn.Interior.ColorIndex = 36
End If
End Sub

(ColorIndex 36 is light yellow. Change to whatever you like).

To start highlighting on that worksheet, run the HiliteOn macro. To stop it,
run the HiliteOff macro. These could be assigned to toolbar buttons.

Hope this helps,

Hutch

"KarenY" wrote:

Hi, could anybody please help -
if I put the cursor on an active cell on a spreadsheet, I want the
corresponding row and column being highlighted (i.e. like a crosshair) - how
do I do that ?

appreciate your answer,
thanks
Karen

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Active cell with a "crosshair" indicator ?

I will definitely study your file and will make mine work. Thanks a million !
This is great help.
Appreciate very much !


thanks
Karen

"Tom Hutchins" wrote:

Definitiely, the Visual Basic Editor can be confusing at first. I have
created a small sample workbook with the crosshairs highlighting code set to
work for Sheet1. Here is a link to it:

http://www.freefilehosting.net/download/3dcfb

To have the code work for Sheet2 (for example), copy & paste the same code
in the Sheet1 code page to the Sheet2 code page. If you want the crosshairs
highlighting to work on every sheet in the workbook, comment out the code on
the individual sheets and uncomment the subroutine on the ThisWorkbook code
page.

Hope this helps,

Hutch

"KarenY" wrote:

I am familiar with recording and running macro but not with VBA-modules.
I followed your instruction.
I pasted starting with "Public NotNow as Boolean" to the workbook - nothing
happens when I run the "HiteOn".
Then I realized I might have to paste the "Private Sub
Worksheet_SelectionChange(ByVal Target As Range)...etc" to the worksheet, so
I did the "paste" - again, nothing happens when I run the "HiteOn".

I am sorry being "stupid".

thanks
Karen

"Tom Hutchins" wrote:

My guess is that you pasted the Public variable and subroutines into the
ThisWorkbook module. That won't work; you have to insert a VBA module. In the
Visual Basic Editor, select Project Explorer from the View menu & make sure
the Project Explorer window is displayed. You should see bold text that says
VBAProject (ABC.xls), where ABC is the name of your workbook. Click the
VBAProject with the name of your workbook, then select Module from the Insert
menu. Paste the code I sent you, starting with "Public NotNow as Boolean",
into the new code module. If you had pasted it into the ThisWorkbook module
earlier, delete it there.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Hutch

"KarenY" wrote:

Thanks Tom,

When I turned on the Macro.
I got "Compile error - Sub or Function not defined".
The "Call HiliteCells" was highlighted for this Compiled error in the
worksheet ?

What shall I do ?

karen

"Tom Hutchins" wrote:

Here is one way to do that - including a way to turn the highlighting on or
off. In the code module for each worksheet where you want this to happen,
paste this code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call HiliteCells(Target)
End Sub

In a VBA module in the same workbook, paste this code:

Public NotNow As Boolean

Public Sub HiliteOn()
NotNow = False
End Sub

Public Sub HiliteOff()
NotNow = True
Cells.Interior.ColorIndex = xlColorIndexNone
End Sub

Public Sub HiliteCells(Target As Range)
If NotNow = False Then
Cells.Interior.ColorIndex = xlColorIndexNone
Target.EntireRow.Interior.ColorIndex = 36
Target.EntireColumn.Interior.ColorIndex = 36
End If
End Sub

(ColorIndex 36 is light yellow. Change to whatever you like).

To start highlighting on that worksheet, run the HiliteOn macro. To stop it,
run the HiliteOff macro. These could be assigned to toolbar buttons.

Hope this helps,

Hutch

"KarenY" wrote:

Hi, could anybody please help -
if I put the cursor on an active cell on a spreadsheet, I want the
corresponding row and column being highlighted (i.e. like a crosshair) - how
do I do that ?

appreciate your answer,
thanks
Karen

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
How to make the active cell "pop out" Julie27 Excel Discussion (Misc queries) 11 October 7th 07 09:11 PM
can I change the color of the "Comment Indicator" from red to ... Dr. Darrell Excel Discussion (Misc queries) 2 March 28th 07 01:50 PM
"red" Triangle in Comment Indicator- make bigger?? MikeR-Oz New Users to Excel 3 April 7th 06 09:29 AM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM
"outline active cell differently than other cells" terri Excel Discussion (Misc queries) 1 January 25th 06 08:26 PM


All times are GMT +1. The time now is 10:17 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"