ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with Tooltip on clipart (https://www.excelbanter.com/excel-programming/429212-help-tooltip-clipart.html)

dgold82

Help with Tooltip on clipart
 
I have a picture of a printer on my worksheet that activates the following
macro. Can someone help me add code to make a tooltip that would display the
words "click to print" when a user hovers the mouse over the image:

Sub PrintSheet()
Application.Dialogs(xlDialogPrint).Show
' Range("AK6").Select
End Sub

Thanks.



Jacob Skaria

Help with Tooltip on clipart
 
Try the below.

1. Select a cell in the same sheet which you are sure is not going to be
used..From menu InsertNameDefine. Assign a name say 'nmtooltip'

2. Right click on the imageHyperlink. Click Screen Tip button to add your
tip. Select the 'place in document' as the the defined name 'nmtooltip'

3. Right click the sheet tab. View code and paste the below code and save.
You dont need to assign macro to the picutre. Instead the PrintSheet will be
called from the selection change event.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("nmToolTip")) Is Nothing Then
Call PrintSheet
Application.Goto Range("A1")
End If
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"dgold82" wrote:

I have a picture of a printer on my worksheet that activates the following
macro. Can someone help me add code to make a tooltip that would display the
words "click to print" when a user hovers the mouse over the image:

Sub PrintSheet()
Application.Dialogs(xlDialogPrint).Show
' Range("AK6").Select
End Sub

Thanks.



r

Help with Tooltip on clipart
 
Sub test()
Dim s As Shape

Set s = ActiveSheet.Shapes("Picture 1")
ActiveSheet.Hyperlinks.Add Anchor:=s, Address:= _
"", SubAddress:="AK6", ScreenTip:="click to print"
s.OnAction = "PrintSheet"
End Sub

regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"dgold82" wrote:

I have a picture of a printer on my worksheet that activates the following
macro. Can someone help me add code to make a tooltip that would display the
words "click to print" when a user hovers the mouse over the image:

Sub PrintSheet()
Application.Dialogs(xlDialogPrint).Show
' Range("AK6").Select
End Sub

Thanks.



Peter T

Help with Tooltip on clipart
 
maybe replace
SubAddress:="AK6",
with
SubAddress:=s.TopLeftCell.Address

Regards,
Peter T

"r" wrote in message
...
Sub test()
Dim s As Shape

Set s = ActiveSheet.Shapes("Picture 1")
ActiveSheet.Hyperlinks.Add Anchor:=s, Address:= _
"", SubAddress:="AK6", ScreenTip:="click to print"
s.OnAction = "PrintSheet"
End Sub

regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"dgold82" wrote:

I have a picture of a printer on my worksheet that activates the
following
macro. Can someone help me add code to make a tooltip that would display
the
words "click to print" when a user hovers the mouse over the image:

Sub PrintSheet()
Application.Dialogs(xlDialogPrint).Show
' Range("AK6").Select
End Sub

Thanks.





dgold82

Help with Tooltip on clipart
 
Thanks Jacob, but I got a compile error...Any ideas?

"Jacob Skaria" wrote:

Try the below.

1. Select a cell in the same sheet which you are sure is not going to be
used..From menu InsertNameDefine. Assign a name say 'nmtooltip'

2. Right click on the imageHyperlink. Click Screen Tip button to add your
tip. Select the 'place in document' as the the defined name 'nmtooltip'

3. Right click the sheet tab. View code and paste the below code and save.
You dont need to assign macro to the picutre. Instead the PrintSheet will be
called from the selection change event.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("nmToolTip")) Is Nothing Then
Call PrintSheet
Application.Goto Range("A1")
End If
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"dgold82" wrote:

I have a picture of a printer on my worksheet that activates the following
macro. Can someone help me add code to make a tooltip that would display the
words "click to print" when a user hovers the mouse over the image:

Sub PrintSheet()
Application.Dialogs(xlDialogPrint).Show
' Range("AK6").Select
End Sub

Thanks.



Jim Cone[_2_]

Help with Tooltip on clipart
 
Hi Peter,
A sub-address is not really required as "" will work.
However, the problem I've never been able to solve is that the assigned
macro is ignored when a hyperlink/screen tip is attached to the shape.
--
Jim Cone
Portland, Oregon USA


"Peter T" <peter_t@discussions
wrote in message
maybe replace
SubAddress:="AK6",
with
SubAddress:=s.TopLeftCell.Address
Regards,
Peter T


Peter T

Help with Tooltip on clipart
 
Hi Jim,

I really thought I had tested before posting but you are right!

Jocob's Application.Goto Range("A1") could be to a cell under the shape.

Regards,
Peter T

"Jim Cone" wrote in message
...
Hi Peter,
A sub-address is not really required as "" will work.
However, the problem I've never been able to solve is that the assigned
macro is ignored when a hyperlink/screen tip is attached to the shape.
--
Jim Cone
Portland, Oregon USA


"Peter T" <peter_t@discussions
wrote in message
maybe replace
SubAddress:="AK6",
with
SubAddress:=s.TopLeftCell.Address
Regards,
Peter T




dgold82

Help with Tooltip on clipart
 
This might be a stupid question, but how do I find my clipart/picture name.
You have "Picture 1" below--not sure what to put for my code. Thanks.

"r" wrote:

Sub test()
Dim s As Shape

Set s = ActiveSheet.Shapes("Picture 1")
ActiveSheet.Hyperlinks.Add Anchor:=s, Address:= _
"", SubAddress:="AK6", ScreenTip:="click to print"
s.OnAction = "PrintSheet"
End Sub

regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"dgold82" wrote:

I have a picture of a printer on my worksheet that activates the following
macro. Can someone help me add code to make a tooltip that would display the
words "click to print" when a user hovers the mouse over the image:

Sub PrintSheet()
Application.Dialogs(xlDialogPrint).Show
' Range("AK6").Select
End Sub

Thanks.



dgold82

Help with Tooltip on clipart
 
Figuired it out using Jacob's method! Just tweaked the code a bit:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("nmToolTip")) Is Nothing Then
Application.Dialogs(xlDialogPrint).Show
Application.Goto Range("A1")
End If
End Sub

"dgold82" wrote:

Thanks Jacob, but I got a compile error...Any ideas?

"Jacob Skaria" wrote:

Try the below.

1. Select a cell in the same sheet which you are sure is not going to be
used..From menu InsertNameDefine. Assign a name say 'nmtooltip'

2. Right click on the imageHyperlink. Click Screen Tip button to add your
tip. Select the 'place in document' as the the defined name 'nmtooltip'

3. Right click the sheet tab. View code and paste the below code and save.
You dont need to assign macro to the picutre. Instead the PrintSheet will be
called from the selection change event.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("nmToolTip")) Is Nothing Then
Call PrintSheet
Application.Goto Range("A1")
End If
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"dgold82" wrote:

I have a picture of a printer on my worksheet that activates the following
macro. Can someone help me add code to make a tooltip that would display the
words "click to print" when a user hovers the mouse over the image:

Sub PrintSheet()
Application.Dialogs(xlDialogPrint).Show
' Range("AK6").Select
End Sub

Thanks.



r

Help with Tooltip on clipart
 
Sub Picture_Name()
Dim v

For Each v In ActiveSheet.Shapes
Debug.Print v.Name
Next

End Sub

regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"dgold82" wrote:

This might be a stupid question, but how do I find my clipart/picture name.
You have "Picture 1" below--not sure what to put for my code. Thanks.

"r" wrote:

Sub test()
Dim s As Shape

Set s = ActiveSheet.Shapes("Picture 1")
ActiveSheet.Hyperlinks.Add Anchor:=s, Address:= _
"", SubAddress:="AK6", ScreenTip:="click to print"
s.OnAction = "PrintSheet"
End Sub

regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"dgold82" wrote:

I have a picture of a printer on my worksheet that activates the following
macro. Can someone help me add code to make a tooltip that would display the
words "click to print" when a user hovers the mouse over the image:

Sub PrintSheet()
Application.Dialogs(xlDialogPrint).Show
' Range("AK6").Select
End Sub

Thanks.



r

Help with Tooltip on clipart
 
well! I learned something :-)
regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"Jim Cone" wrote:

Hi Peter,
A sub-address is not really required as "" will work.
However, the problem I've never been able to solve is that the assigned
macro is ignored when a hyperlink/screen tip is attached to the shape.
--
Jim Cone
Portland, Oregon USA


"Peter T" <peter_t@discussions
wrote in message
maybe replace
SubAddress:="AK6",
with
SubAddress:=s.TopLeftCell.Address
Regards,
Peter T



r

Help with Tooltip on clipart
 
however, my solution does not work
Watch the intervention of Jim Cone
regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"r" wrote:

Sub Picture_Name()
Dim v

For Each v In ActiveSheet.Shapes
Debug.Print v.Name
Next

End Sub

regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"dgold82" wrote:

This might be a stupid question, but how do I find my clipart/picture name.
You have "Picture 1" below--not sure what to put for my code. Thanks.

"r" wrote:

Sub test()
Dim s As Shape

Set s = ActiveSheet.Shapes("Picture 1")
ActiveSheet.Hyperlinks.Add Anchor:=s, Address:= _
"", SubAddress:="AK6", ScreenTip:="click to print"
s.OnAction = "PrintSheet"
End Sub

regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"dgold82" wrote:

I have a picture of a printer on my worksheet that activates the following
macro. Can someone help me add code to make a tooltip that would display the
words "click to print" when a user hovers the mouse over the image:

Sub PrintSheet()
Application.Dialogs(xlDialogPrint).Show
' Range("AK6").Select
End Sub

Thanks.



Jacob Skaria

Help with Tooltip on clipart
 

Sub Macro()
Dim obj As Object
For Each obj In ActiveSheet.DrawingObjects
Debug.Print obj.Name
Next
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"dgold82" wrote:

This might be a stupid question, but how do I find my clipart/picture name.
You have "Picture 1" below--not sure what to put for my code. Thanks.

"r" wrote:

Sub test()
Dim s As Shape

Set s = ActiveSheet.Shapes("Picture 1")
ActiveSheet.Hyperlinks.Add Anchor:=s, Address:= _
"", SubAddress:="AK6", ScreenTip:="click to print"
s.OnAction = "PrintSheet"
End Sub

regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"dgold82" wrote:

I have a picture of a printer on my worksheet that activates the following
macro. Can someone help me add code to make a tooltip that would display the
words "click to print" when a user hovers the mouse over the image:

Sub PrintSheet()
Application.Dialogs(xlDialogPrint).Show
' Range("AK6").Select
End Sub

Thanks.




All times are GMT +1. The time now is 11:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com