PC Review


Reply
 
 
johnpotter94501
Guest
Posts: n/a
 
      23rd Nov 2009
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
 
Reply With Quote
 
 
 
 
Rick Rothstein
Guest
Posts: n/a
 
      23rd Nov 2009
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" <(E-Mail Removed)> wrote in
message news:2DB03840-CBCF-45FC-AD32-(E-Mail Removed)...
>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


 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      23rd Nov 2009
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" <(E-Mail Removed)> wrote in message
news:OapeSq%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in
> message news:2DB03840-CBCF-45FC-AD32-(E-Mail Removed)...
>>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

>


 
Reply With Quote
 
Max
Guest
Posts: n/a
 
      23rd Nov 2009
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


 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      23rd Nov 2009
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>


 
Reply With Quote
 
johnpotter94501
Guest
Posts: n/a
 
      24th Nov 2009
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

 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      24th Nov 2009
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" <(E-Mail Removed)> wrote in
message news:BFC9432A-6EB5-4FAA-AB90-(E-Mail Removed)...
> 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


 
Reply With Quote
 
Max
Guest
Posts: n/a
 
      24th Nov 2009
Superb! Many thanks for your solution, Rick.


 
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
Row Column Cross Hair h2fcell Microsoft Excel Worksheet Functions 3 1st Oct 2008 04:32 PM
Cross Hair not visible when on black background =?Utf-8?B?Q0VvcmlvbmZhbg==?= Windows Vista General Discussion 3 13th Oct 2007 02:49 PM
hair cross cursor Otto Atzwanger Microsoft VB .NET 3 10th Mar 2006 01:11 PM
Can the mouse pointer property be set to a cross-hair? =?Utf-8?B?UkFN?= Microsoft Access Database Table Design 8 4th Jan 2006 03:51 AM
How do I locate a highlighted cell as a cross hair type reference =?Utf-8?B?TWlrZQ==?= Microsoft Excel Setup 2 6th Oct 2005 04:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:46 AM.