Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Superb! Many thanks for your solution, Rick.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Row Column Cross Hair | Excel Worksheet Functions | |||
please help me keep my hair....... | Excel Discussion (Misc queries) | |||
Ripping my hair out, please help! | Excel Discussion (Misc queries) | |||
How do I locate a highlighted cell as a cross hair type reference | Setting up and Configuration of Excel | |||
tearing my hair out can it be done | Charts and Charting in Excel |