Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default onmouseover event



Hi!

I have this code and it works but it should be nice if the macro2 could
run with an onmouseover event. Is this possible? If it is, is it also
possible to get the old text with somthing like onmouse out?

Sub Macro3()

ActiveSheet.Shapes.AddTextbox(msoTextOrientationHo rizontal, 346.5,
105#, _
100.5, 63#).Select
Selection.Characters.Text = "Text"
Selection.Name = "MyTextBox"
Selection.OnAction = "Macro2" 'insert new text
End Sub

Sub Macro2()
ActiveSheet.Shapes("MyTextBox").Select
Selection.Characters.Text = "New Text"
Range("F20").Select
End Sub

Thanks in advance

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default onmouseover event

The various "built in" mouse events are only coded to work with objects that
are on a User Form (as distinct from objects drawn on a worksheet).

User forms are good fun and very functional and they give your application a
professional look, which can be handy if other people are using it. Worth
considering .....

--
"I've played in front of many talented audiences"


"Kalle" wrote:



Hi!

I have this code and it works but it should be nice if the macro2 could
run with an onmouseover event. Is this possible? If it is, is it also
possible to get the old text with somthing like onmouse out?

Sub Macro3()

ActiveSheet.Shapes.AddTextbox(msoTextOrientationHo rizontal, 346.5,
105#, _
100.5, 63#).Select
Selection.Characters.Text = "Text"
Selection.Name = "MyTextBox"
Selection.OnAction = "Macro2" 'insert new text
End Sub

Sub Macro2()
ActiveSheet.Shapes("MyTextBox").Select
Selection.Characters.Text = "New Text"
Range("F20").Select
End Sub

Thanks in advance

*** Sent via Developersdex http://www.developersdex.com ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default onmouseover event



Thanks for your answer.

You say that mouse events only works in userforms but if I insert a
control in a worksheet? Does a control have the same mouse evnts in a
worksheet?

I use userforms in this project but it should be nice if I can use a
mouse event in one of my worksheets.

I need something transparent that start a event macro. I try to insert
label by code but I can't set it to transparet. If that is possible that
should solve my problem.

Regards
Kalle

*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default onmouseover event

I'm not 100% sure I understand exactly what you are trying to achieve, but as
far as I have ever seen, there is no way to use a Mouse event on a worksheet,
only on user forms. If I were doing what I think you are trying to do, I
would activate macro2 using the RightClick or DoubleCLick event, which WILL
work on a worksheet.
I would restrict the operation of the event procedure to a particular cell
or group of cells (using the "Target" parameter in the event) and use "Cancel
= True" so that the normal default right-click event would not also occur.
You could put the desired code in the Event procedure itself or have it call
the code from a separate Sub.
In the cell(s) that you want to use as a trigger, you could put some text
like "Run Text Procedure (R-Click)" as a visual cue. Exactly how or whether
you do that would depend on whether other people are going to be using your
app and (therefore) whether a visual cue is necessary.
I do a lot of this "event driven" stuff in apps that are used by 50 or 60
people who have varying levels of IT savvy. You need to put a lot of thought
into it, mainly on two grounds (1) You have to provide a strong intuitive
interface for the less IT-savvy people without treating the "ITsmart" people
like dummies (2) Sheet events add layers of complexity to the whole project
and can have unintended consequences which then need solutions that require
another level of complexity. But the event-driven app can be extremely
"smart" and user-friendly if you get it right and stay on top of the
complexities.


--
Time is just the thing that keeps everything from happening all at once


"kalle" wrote:



Thanks for your answer.

You say that mouse events only works in userforms but if I insert a
control in a worksheet? Does a control have the same mouse evnts in a
worksheet?

I use userforms in this project but it should be nice if I can use a
mouse event in one of my worksheets.

I need something transparent that start a event macro. I try to insert
label by code but I can't set it to transparet. If that is possible that
should solve my problem.

Regards
Kalle

*** Sent via Developersdex http://www.developersdex.com ***

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
apply cell change event to single column - WorksheetChange Event [email protected] Excel Programming 6 May 4th 08 02:28 AM
Click event on menu item is lost after first time firing of the event [email protected] Excel Programming 1 April 2nd 07 01:25 PM
onMouseOver Highlight Rows sh0gun Excel Programming 3 November 7th 05 02:28 PM
How to trap delete row event and hide column event? Alan Excel Programming 3 April 26th 05 04:25 PM
user form-on open event? keydown event? FSt1[_3_] Excel Programming 2 August 5th 04 02:26 PM


All times are GMT +1. The time now is 11:26 AM.

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"