+ Reply to Thread
Results 1 to 4 of 4

Crosshairs instead of hand?

  1. #1
    Registered User
    Join Date
    03-02-2006
    Posts
    17

    Crosshairs instead of hand?

    I have assigned a macro to a picture pasted in a worksheet. When I drag the cursor over this picture, the cursor turns into a little hand to indicate that the picture is assigned to a macro. Is there any way I could change this so, instead of the little hand, the cursor becomes a set of crosshairs?

  2. #2
    Forum Contributor
    Join Date
    12-12-2005
    Posts
    667
    Since a crosshair cursor is not standard, you would have to draw one.
    Sub MousePointer()
    ActiveSheet.Shapes("Picture 1").MousePointer = LoadPicture("c:\crosshair.ico")
    End Sub
    Best regards,

    Ray

  3. #3
    Registered User
    Join Date
    03-02-2006
    Posts
    17

    How do I make this work?

    Thanks for the reply, however, I cannot get it to work. I took your code and modified it as such:

    Sub MousePointer()
    picname = Cells(1, 9).Value
    ActiveSheet.Shapes(picname).MousePointer = LoadPicture("C:\crosshair.bmp")
    End Sub

    Obviously, the name of the picture to which I have assigned a macro is held in cell (1,9), and I made a picture of crosshairs that are stored on the C: drive. When I put this macro in my file, and then I drag the cursor over the picture ("called picname"), it still looks like a hand, it doesn't look like the crosshairs I drew.

    A few questions:

    1) Does it matter that my picture is a bitmap instead of an icon?

    2) How can I package this with the file so that any user will have access? Can I paste the picture in a worksheet, hide it, then copy from the worksheet?

    3) Does the above subroutine need to be in the Worksheet code? Right now I have it in a module.

  4. #4
    Forum Contributor
    Join Date
    12-12-2005
    Posts
    667
    1) Does it matter that my picture is a bitmap instead of an icon?
    I believe so!

    2) How can I package this with the file so that any user will have access? Can I paste the picture in a worksheet, hide it, then copy from the worksheet?
    I would use a VB 6 with a ressource file

    3) Does the above subroutine need to be in the Worksheet code? Right now I have it in a module.
    I would put it in an add-in.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1