Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Change Mouse Pointer Image in Workbook

I have a Worksheet Double Click Event in a particular Workbook. Is there a
way to change the mouse image from a "plus sign" to a typical "arrow"? This
would help to me more precise in double clicking cells.
--
Cheers,
Ryan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default Change Mouse Pointer Image in Workbook

The following event macros will make the cursor an arrow whenever the
workbook containing them is active:

Private Sub Workbook_Activate()
Application.Cursor = xlNorthwestArrow
End Sub

Private Sub Workbook_Deactivate()
Application.Cursor = xlDefault
End Sub

Copy & paste these into the ThisWorkbook module of your workbook. If you are
new to macros, this link to Jon Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Hope this helps,

Hutch

"RyanH" wrote:

I have a Worksheet Double Click Event in a particular Workbook. Is there a
way to change the mouse image from a "plus sign" to a typical "arrow"? This
would help to me more precise in double clicking cells.
--
Cheers,
Ryan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Change Mouse Pointer Image in Workbook

It works ok, but two questions.

1.) When I change to the VBE, my cursor doesn't change to the default,
because the workbook I am coding is still active. Is there a way have the
..Cursur = xlNorthwestArrow only when the workbook is the active window? Then
change back to xlDefault when I enter the VBE as the active window.

2.) I wanted to change the cursor to xlNorthwestArrow because I have a
Worksheet Double Click Event. I wanted to improve accuracy of the cursor so
the desired cell could accurately be double clicked. Althought the arrow
cursor does help I still have a small problem. When a user accidentally
double clicks between two cells Excel automatically jumps to the very top or
bottom of the UsedRange in that column. Is there a way to prevent that? I
tried setting Cancel = True in my Worksheet Double Click Event, but it
doesn't seem to work. Any ideas?
--
Cheers,
Ryan


"Tom Hutchins" wrote:

The following event macros will make the cursor an arrow whenever the
workbook containing them is active:

Private Sub Workbook_Activate()
Application.Cursor = xlNorthwestArrow
End Sub

Private Sub Workbook_Deactivate()
Application.Cursor = xlDefault
End Sub

Copy & paste these into the ThisWorkbook module of your workbook. If you are
new to macros, this link to Jon Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Hope this helps,

Hutch

"RyanH" wrote:

I have a Worksheet Double Click Event in a particular Workbook. Is there a
way to change the mouse image from a "plus sign" to a typical "arrow"? This
would help to me more precise in double clicking cells.
--
Cheers,
Ryan

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default Change Mouse Pointer Image in Workbook

1. I don't have an elegant solution for this, but I have a workaround.
Instead of
using WorkBook events, use WorkSheet events:

Private Sub Worksheet_Activate()
Application.Cursor = xlNorthwestArrow
End Sub

Private Sub Worksheet_Deactivate()
Application.Cursor = xlDefault
End Sub

Copy & paste the code above into the code page for each sheet where the
cursor
should be altered this way. Create a Workbook_Open sub like the following in
the
ThisWorkbook module:

Private Sub Workbook_Open()
Sheets("Sheet1").Activate
End Sub

Change Sheet1 to the name of one of the sheets with the Worksheet_Activate
event
code. This is to ensure that the Worksheet_Activate event gets triggered.

None of this, in itself, fixes the VBE cursor problem. When you are in the
VBE, the active window is still the active worksheet, not the VBE. You will
see this if you run the following sub in the VBE:

Sub AAAAA()
MsgBox ActiveWindow.Caption
End Sub

So, the workaround is to have at least one sheet that does NOT have the
cursor-changing event code. Make that the active sheet before you go to the
VBE. You could put it in a macro like this:

Sub GotoVBE()
ThisWorkbook.Sheets("Sheet4").Activate
Application.SendKeys "%{F11}"
End Sub

There may be a slick way (maybe using API calls) to determine when you are
in the VBE. Perhaps one of the MVPs knows, and can enlighten us both.

2. I don't have a solution for this. Double-clicking a cell border doesn't
trigger any events I can identify - not Worksheet_BeforeDoubleClick, and not
Workbook_SheetBeforeDoubleClick. Tell your users to click in the middle of
the cells.

Hope this helps,

Hutch

"RyanH" wrote:

It works ok, but two questions.

1.) When I change to the VBE, my cursor doesn't change to the default,
because the workbook I am coding is still active. Is there a way have the
.Cursur = xlNorthwestArrow only when the workbook is the active window? Then
change back to xlDefault when I enter the VBE as the active window.

2.) I wanted to change the cursor to xlNorthwestArrow because I have a
Worksheet Double Click Event. I wanted to improve accuracy of the cursor so
the desired cell could accurately be double clicked. Althought the arrow
cursor does help I still have a small problem. When a user accidentally
double clicks between two cells Excel automatically jumps to the very top or
bottom of the UsedRange in that column. Is there a way to prevent that? I
tried setting Cancel = True in my Worksheet Double Click Event, but it
doesn't seem to work. Any ideas?
--
Cheers,
Ryan


"Tom Hutchins" wrote:

The following event macros will make the cursor an arrow whenever the
workbook containing them is active:

Private Sub Workbook_Activate()
Application.Cursor = xlNorthwestArrow
End Sub

Private Sub Workbook_Deactivate()
Application.Cursor = xlDefault
End Sub

Copy & paste these into the ThisWorkbook module of your workbook. If you are
new to macros, this link to Jon Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Hope this helps,

Hutch

"RyanH" wrote:

I have a Worksheet Double Click Event in a particular Workbook. Is there a
way to change the mouse image from a "plus sign" to a typical "arrow"? This
would help to me more precise in double clicking cells.
--
Cheers,
Ryan

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change mouse pointer in Excel 07 DSDShelp Excel Discussion (Misc queries) 3 November 17th 08 11:01 PM
Change Mouse Pointer on protected sheet. RyanH Excel Programming 0 September 8th 08 12:53 PM
Mouse pointer (arrow) change color? robert morris Excel Discussion (Misc queries) 3 February 14th 08 03:32 PM
Mouse pointer change john theo Excel Discussion (Misc queries) 0 September 22nd 06 03:09 PM
need to change num key pad from moving the mouse pointer RANDY Excel Worksheet Functions 1 December 12th 05 10:36 PM


All times are GMT +1. The time now is 10:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"