Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    May 2016
    Posts
    50
    Thanks
    9
    Thanked 4 Times in 4 Posts

    Changing default cursor in excel - how to ?

    ok, so this seemed to be a very simple thing, so i wrote this....

    Code:
    Function CursorChange(State As String)
        If State = "Reset" Then
            Application.Cursor = xlDefault
        ElseIf State = "Change" Then
            Application.Cursor = xlNorthwestArrow
        End If
    End Function

    simples! ....... or so i thought !


    Whilst this does exactly what is says on the tin, when you call CursorChange("Change") or "Reset", what i wasn't expecting it to do was change it's behavior, let me explain.....

    All i wanted was to get rid of that ugly-ass thick white cross that excel has as the default cursor when moving over the worksheet/spreadsheet area, i wanted the new selection to behave exactly the same as the original when i, say, edit a cell, in that it should switch to the I-Beam, or when i mouse over a control box that has a hand icon assigned, it should switch to that new icon.

    Using the code above, does indeed change the cursor, but it also disables ANY other changes


    help !

    (end goal was to get rid of the cross for the arrow, and then later see if i could change said cursor to a faded/grey one when i mouse over a locked sell)

  2. #2
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,826
    Thanks
    136
    Thanked 482 Times in 459 Posts
    Hi Gunslinger

    (end goal was to get rid of the cross for the arrow, and then later see if i could change said cursor to a faded/grey one when i mouse over a locked sell)
    ..a locked sell???? is this to do with stocks and shares????

    Good luck with trying to change Excels mouse pointer!!! It's the stuff of nightmares.
    It's like buying a diesel-engined car and wanting to convert it to solar-power.

    Anyway, in my attached sample file, I quickly added a modification to show a 'locked/unlocked' picture as you move the mousepointer around the sheet. You 'turn-on' this behaviour with a mouse 'right-click' as per previous row-highlighting thingy.
    Maybe you could use something like that.

    zeddy
    Attached Files Attached Files

  3. #3
    Star Lounger
    Join Date
    May 2016
    Posts
    50
    Thanks
    9
    Thanked 4 Times in 4 Posts
    hahahahahahahaha

    i never saw that typo, but yes, that'd be the workbook lol (new one of those about to be uploaded as i've been playing a lot with it, so thought would be good to update the one i had there)


    will have a look at your file, as it's always good to learn/see new things in action


    EDIT:
    and yes, i've crossed swords so to speak with cursors in the past, with mixed results

  4. #4
    Star Lounger
    Join Date
    May 2016
    Posts
    50
    Thanks
    9
    Thanked 4 Times in 4 Posts
    ok, i got errors all over the place on that file, first thing were 2 functions not 64bit office compatible, fixed those then got type mismatch, so i missed something in there relating to longptr i guess, but, that uses times again, so i don't think i want to go down that route, i can live with the standard cross cursor, i was just hoping (naively) that if you swapped out the base cursor (default one) then the replacement would behave the same and not over-ride subsequent instructions to change

    some you win some you lose !.... my spin button now works as i want, so i'll take that as my win !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •