Crosshairs for quick cell location - temporary highlight columns and rows intersecting cell

L

Legacy 277976

Guest
Does anyone know a way to make excel show a "cross-hair" on the cell you have selected? Something that highlights the fill of the rows and the columns intersecting the cell you have last clicked on (nothing permanent, I don't want to be changing the fill of other cells), more as a means to make it easier to find where you are working quickly. In my case, I am quickly switching between two screens and multiple spreadsheets, the short period of time it takes to get re-oriented on the spreadsheet tends to add up and generally contribute to my workday malaise.

I know that by default Excel shows which row and column you have selected, but sometimes my spreadsheet is vast and my magnification is low and it's still hard to intuitively find the cell you are last working on. The latest version of SnagIt (the Screenshot Software) has a cool way of doing this where it presents crosshairs from the cursor and darkens everything on the screen excel for the box you left click, drag and draw. Publisher and Word do this to some degree but with the scaling lines on the margin rulers.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Unlike other methods this doesn't interfere with cell contents.
What I do is draw 2 rectangles on the sheet and make them transparent. These will act as my cross hairs.
Then in the active sheet I add the following code in VBA...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)


With ActiveSheet.Shapes("Rectangle 1")
.Left = 0
.Top = Target.Top
.Height = Target.Height
.Width = 19638
End With


With ActiveSheet.Shapes("Rectangle 2")
.Left = Target.Left
.Top = 0
.Height = 19638
.Width = Target.Width
End With


End Sub

sheet.png
 
Upvote 0
Ok I also tried putting this macro in but I get this 'Argument not optional' message? Do the rectangles need to be the exact size of the ones in your example for this macro to work? I just draw the rectangles in my spreadsheet or do I actually highlight the column and the row that are to intersect?
 
Upvote 0
Drawing 2 rectangles should do it. They do not need to be exact size as the code resizes automatically.

Check the names of the rectangles.
Sometimes Excel names them Rectangle 3 and Rectangle 4 - depends on whether there have been previous objects in the sheet.
Change the code to reflect the exact rectangle names

in

With ActiveSheet.Shapes("Rectangle 1")]#

hope this helps.
regards
Mark
 
Upvote 0
When I run the macro, it is not available for selection. Also, how do I check the names of the rectangles?

Do I need to add that ]# to the end of the line?
 
Upvote 0
Hey Guys,

That is funny. I just got request to find out how to do this again. I remember in excel 2003 there used to be a key combination to activate this. Anybody remember how this was done. I used this all the time at a previous job. Didn't require any VBA either.

later

Ty
 
Upvote 0
Hi JamesFrames8,

Found this somewhere:

Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = xlNone
ActiveCell.EntireRow.Interior.ColorIndex = 34
ActiveCell.EntireColumn.Interior.ColorIndex = 34
End Sub
<colgroup><col width="56" style="width: 42pt;"> <tbody> </tbody>

Will highlight the cell. Can change the color of highlightby changing number ie 34.

Thanks
<colgroup><col width="56" style="width: 42pt;"> <tbody> </tbody>






<colgroup><col width="56" style="width: 42pt;"> <tbody> </tbody>
 
Upvote 0
The issue with the above code is that it will erase any color formatting previously applied. The following implements Control+h as the shortcut for it:

Code:
' at sheet module
Private Sub Worksheet_Activate()
Application.OnKey "^h", "CrossHair"
End Sub


' at a module
Sub CrossHair()
Union(ActiveCell.EntireColumn, ActiveCell.EntireRow).Select
End Sub
 
Upvote 0
Hey Guys,

Does anyone remember what version of Excel it was that actually had it built in?

later

Ty
 
Upvote 0
Here's another way.

Make these UDF's
Code:
Function ActiveRow() As Long
    ActiveRow = ActiveCell.Row
End Function
Function ActiveColumn() As Long
    ActiveColumn = ActiveCell.Column
End Function
then set conditional formatting on all cells with the formula
=OR(ROW(A1)=ActiveRow(), COLUMN(A1)=ActiveColumn())

Then put this in the sheet's code module.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Calculate
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,428
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top