Hiding the Cursor

When I do some screen shots, I need to hide the cursor. Not only do I want no cell selected, but I don’t want the column or row headers highlighted – so I can’t just page down for instance. Manually, I was using Ctrl+End to get to the last cell followed by a few tabs and a few page downs. Then I’d click the scroll bars to get A1 back into view. Being the mouse-a-phobe that I am, you can imagine how infuriating this is. Here’s the macro I use now

Sub HideCursor()
   
    With ActiveSheet.UsedRange
        .Cells(.Rows.Count + 100, .Columns.Count + 100).Select
    End With
   
    ActiveWindow.ScrollIntoView 0, 0, 1, 1
   
End Sub

Is there a way to do this without a macro that I’m missing? Is there a better way to do this with a macro?

Posted in Uncategorized

27 thoughts on “Hiding the Cursor

  1. Hi Dick,

    What about:

    Sub HideCursor()
    ActiveSheet.Protect
    ActiveSheet.EnableSelection = xlNoSelection
    ActiveWindow.ScrollColumn = 1
    ActiveWindow.ScrollRow = 1
    Selection.Name = “DDoE”
    End Sub

    Sub ShowCursor()
    ActiveSheet.EnableSelection = xlNoRestrictions
    ActiveSheet.Unprotect
    ActiveWindow.ScrollColumn = ActiveCell.Column
    ActiveWindow.ScrollRow = ActiveCell.Row
    On Error Resume Next
    Selection.Name.Delete
    End Sub

  2. Alt-Tab to focus another program, and your selection won’t show.

    You must tile your windows some way before that though. I use my mouse to tile windows. And everything else. Most of the times I’ve survived …

  3. This sort of defeats the spirit of what you want, but it accomplished what you need for a screenshot. ..

    I just (temporarily) protect the sheet and uncheck both the allow users to select locked / unlocked cells. Any selected cells / rows / columns are de-selected… then I just use one of those freeware “grab it” type copy-to-the-clipboard programs.

  4. How about this one-statement toggle?

    Sub ToggleCellSelection()
    If ActiveSheet.EnableSelection = xlNoSelection Then ActiveSheet.EnableSelection = xlNoRestrictions Else ActiveSheet.EnableSelection = xlNoSelection
    End Sub

  5. Maybe, I am missing something but with very few exceptions, I always crop a screenshot so that it focuses attention on whatever it is I am discussing(*). So, all one has to do is select a cell just outside the intended region.

    For example, if I want to the Name Box in the screenshot, I would include the first few menu names, a small part of the formula bar (extending a bit to the right of the ‘fx’, the column headers that fall in that width (A:C with the default widths), and a couple of rows. This makes it easy for the reader to quickly get a sense of the location of the name box.

    Given the above, just select E4 confident in the knowledge that that cell will be absent from the final cut.

    Even if one wants to show the entire screen uncropped, all one has to do is select a cell just outside the actual visible range. Scroll one screen height down (PAGE DOWN key), one screen width to the right (ALT + PAGE DOWN combo), one mouse click just above the vertical scroll handle {shudder} and one more just to the right of the horizontal scroll handle {shudder, shudder} (#) to get back to the intended range.

    (*) Usually, I *intentionally* crop in a way that slices through something (making the crop that much more noticable). In the example above, I would probably slice through a menu name and/or a column and/or a row.

    (#) Unlike Dick I use the mouse heavily (I guess it’s part of my Mac heritage {grin}). In fact, it took me several tries to figure out the ALT+PAGE DOWN combo to scroll one screen width to the right.

  6. Tushar, I don’t think Dick would disagree with you about focusing attention on the topic at hand. He’s capturing worksheet images for a book, and he just wants to show a range of cells. Having an active cell and row & column highlights distract from the image by focusing attention on irrelevant details. He’s just looking for a quick way to eliminate the active cell and row/column highlights.

    That said, my simple little macro is the ultimate solution. I win!!!

  7. JWalk – do I need to protect the sheet for EnableSelection to work?

    Tushar – So all I need is two shortcut key combinations and then two mouse clicks? You’re a tool of the mouse industry. :)

    cfrye – I use SnagIt and I really like it. It hides the window cursor, but not the activecell in Excel.

  8. The magic key sequence as follows:
    PageDown, PageDown, Alt+PageDown, Alt+PageDown, ScrollLock, PageUp, PageUp, Alt+PageUp, Alt+PageUp, ScrollLock
    Try it a few times, it gets easier.

    With ActiveWindow
        .LargeScroll 2, , 2
        .VisibleRange(1).Select
        .LargeScroll -2, , -2
    End With

    Cheers,
    Rob

  9. John: The important part of my comment was that one has to select something just outside the area that will remain in the final version. In the example I used selecting E4 would be adequate since it would not appear in the final image. Similarly, even if one includes the complete monitor in the screenshot, selecting something just outside the visible range is adequate.

    Dick: For every mouse click you save, you can buy me a drink. No, never mind. I doubt I could drink that much. {grin} Never having been to Omaha before, I gotta ask…there is a bar in town, right? {g,d,r}

  10. Related but slightly off-topic…

    When preparing instructions to be used by colleagues, I need to include the cursor itself (i.e the arrow). Taking a screen-dump doesn’t pick this up, so I usually paste the screen-dump into Powerpoint and then draw a white arrow over the image. However, it’s a painstaking process getting the size and angle of the arrow similar to the cursor in Excel.

    Does anyone have any bright ideas how to deal with this?

  11. Neil says: Does anyone have a bright idea for getting te cursor on the screen-dump.

    Use the freeware program MWSnap from http://www.mirekw.com
    This program has a lot of options for taking a screendump. When the screendump is made, you can add different types of cursors.

  12. Neil,

    I use a freeware screen grabber called HardCopy (http://www.hardcopy.de) which allows you to insert a variety of standard cursor shapes (arrow, I-beam, egg-timer etc). It won’t allow you to do stuff like the cursor you get when hovering over the join between two columns but maybe you can draw your own close approximation.

    Gareth

  13. Neil:

    Use a picture of a cursor in you excel workbook. You can then place this where ever you want and then do a printscreen.
    Check your Windows directory for a folder called Cursors.

  14. Neil: I use a shareware product HyperSnap from http://www.hyperionics.com/ It has lots of bells and whistles I have never used. I’ve used its ability to (a) define the region to snap, (b) optionally capture the cursor, and (c) snap a picture after a delay. Combine them and it’s possible to show all kinds of things.

    A competitor to HyperSnap that others have made very positive comments about is SnagIt from http://www.techsmith.com/

  15. Hi,

    another proposal:

    Put a CommandButton into the sheet with following code:

    Private Sub CommandButton1_Click()
    ActiveWindow.ScrollIntoView 0, 0, 1, 1
    CommandButton1.TakeFocusOnClick = True
    End Sub

    Regards,
    Beate

  16. Beate…

    Add another line..

    CommandButton1.Visible = False

    The button and the cursor will disappear

    and in the worksheet selection change

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    CommandButton1.Visible = True

    End Sub

    to bring the button back…

    Sam

  17. Dick

    Disable Screen updating and move cursor just out of view for screen capture

    Sub MoveCursor()
    Application.ScreenUpdating = False
    Do
    ActiveCell.Offset(1, 0).Select
    Loop Until Intersect(Rows(ActiveCell.Row), ActiveWindow.VisibleRange) Is Nothing

    Do
    ActiveCell.Offset(0, 1).Select
    Loop Until Intersect(Columns(ActiveCell.Column), ActiveWindow.VisibleRange) Is Nothing
    End Sub

    Regards
    Andrew

  18. You could also just use the original macro you first posted and then just hide the first column (i have no idea why this works). It eliminates having to scroll back up, though you’d have to insert and hide the first column of each worksheet…

  19. Why not use the protect/unprotect function? If you unselect all options when you protect your sheet cursor and cell selection are “gone”. Do your thing and raise projection afterwards.


Posting code? Use <pre> tags for VBA and <code> tags for inline.

Leave a Reply

Your email address will not be published.