#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default cross hair

i am a teacher and use excell for grades . Names on top assignments on the
right side. i am trying to make cross hairs what ever cell i click into i
will see a color line vertical and horsonal to help me make sure the right
grades are entered. i have office 2007 pro.
--
Mr. Coffee
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default cross hair

Does this SelectionChange event code do what you want...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = 0
Union(Target.EntireColumn, Target.EntireRow).Interior.ColorIndex = 40
End Sub

Change the ColorIndex value to suit your own personal tastes.

--
Rick (MVP - Excel)


"johnpotter94501" wrote in
message ...
i am a teacher and use excell for grades . Names on top assignments on the
right side. i am trying to make cross hairs what ever cell i click into i
will see a color line vertical and horsonal to help me make sure the right
grades are entered. i have office 2007 pro.
--
Mr. Coffee


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default cross hair

It occurs to me that you may not know how to implement the code I gave you
earlier. Right click the tab at the bottom of the worksheet where you want
to create the cross hair indicator, select View Code from the popup menu
that appears and then copy/paste the code I gave you earlier into the code
window that appeared.

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
Does this SelectionChange event code do what you want...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = 0
Union(Target.EntireColumn, Target.EntireRow).Interior.ColorIndex = 40
End Sub

Change the ColorIndex value to suit your own personal tastes.

--
Rick (MVP - Excel)


"johnpotter94501" wrote in
message ...
i am a teacher and use excell for grades . Names on top assignments on the
right side. i am trying to make cross hairs what ever cell i click into i
will see a color line vertical and horsonal to help me make sure the
right
grades are entered. i have office 2007 pro.
--
Mr. Coffee



  #4   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default cross hair

Rick, Thanks for sharing your crosshair sub. Is there a way in which we can
control that worksheet sub's activation/deactivation via say, another sub
assigned to a button? This is meant to enable "normal" mode (ie with
crosshair sub deactivated) so that we can work on the sheet as per normal,
with undo available, and switch-over to activate the crosshair sub whenever
required. Thanks


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default cross hair

Here is one way to do that. Replace the code I posted earlier with the all
the code I have marked below instead. To activate/deactivate the crosshair
mode, just double click any cell on the worksheet... if the crosshair is
visible, it will be turned off... if the crosshair is not visible, it will
be turned on.

'*************** START OF CODE ***************
Dim CrosshairModeOn As Boolean

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)
Cancel = True
CrosshairModeOn = Not CrosshairModeOn
If CrosshairModeOn Then
Union(Target.EntireColumn, Target.EntireRow).Interior.ColorIndex = 15
Else
Cells.Interior.ColorIndex = 0
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If CrosshairModeOn Then
Cells.Interior.ColorIndex = 0
Union(Target.EntireColumn, Target.EntireRow).Interior.ColorIndex = 15
End If
End Sub
'*************** END OF CODE ***************

--
Rick (MVP - Excel)


"Max" wrote in message
...
Rick, Thanks for sharing your crosshair sub. Is there a way in which we
can control that worksheet sub's activation/deactivation via say, another
sub assigned to a button? This is meant to enable "normal" mode (ie with
crosshair sub deactivated) so that we can work on the sheet as per normal,
with undo available, and switch-over to activate the crosshair sub
whenever required. Thanks





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default cross hair

Rick the code worked fine except when i close the file it won't work again .
also can i defult this to the workbook john
--
Mr. Coffee


"johnpotter94501" wrote:

i am a teacher and use excell for grades . Names on top assignments on the
right side. i am trying to make cross hairs what ever cell i click into i
will see a color line vertical and horsonal to help me make sure the right
grades are entered. i have office 2007 pro.
--
Mr. Coffee

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default cross hair

Which code are we talking about, the SelectionChange event code (which
should work when you open the workbook again) or the macro version (which
requires you to start it each time you open the workbook)? As for defaulting
the code to the workbook "john"... if you put it in that workbook, it should
be available whenever you open that workbook. Perhaps if you can provide
more detail describing what you want to happen, then we won't have to try
and guess at what you are ultimately looking for.

--
Rick (MVP - Excel)


"johnpotter94501" wrote in
message ...
Rick the code worked fine except when i close the file it won't work again
.
also can i defult this to the workbook john
--
Mr. Coffee


"johnpotter94501" wrote:

i am a teacher and use excell for grades . Names on top assignments on
the
right side. i am trying to make cross hairs what ever cell i click into i
will see a color line vertical and horsonal to help me make sure the
right
grades are entered. i have office 2007 pro.
--
Mr. Coffee


  #8   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default cross hair

Superb! Many thanks for your solution, Rick.


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
Row Column Cross Hair h2fcell Excel Worksheet Functions 3 October 1st 08 04:32 PM
please help me keep my hair....... izzyt1972 Excel Discussion (Misc queries) 6 January 4th 08 10:13 AM
Ripping my hair out, please help! trafficbroker Excel Discussion (Misc queries) 5 November 18th 05 04:43 PM
How do I locate a highlighted cell as a cross hair type reference Mike Setting up and Configuration of Excel 2 October 6th 05 04:41 AM
tearing my hair out can it be done itsglitzy Charts and Charting in Excel 2 December 1st 04 06:15 AM


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