How to "Undo" Hover Actions in VBA

jbiehl

Board Regular
Joined
Jul 30, 2020
Messages
59
Office Version
  1. 365
Platform
  1. Windows
Good Afternoon!
I'm struggling... I have a code for certain actions to occur when I hover over the "OctGB" command button... but how to I make it revert those actions when I'm no longer hovering over "OctGB"?
I feel like it should be obvious, but Google is failing me on this one.
Thanks!
----------------------
Private Sub OctGB_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
ActiveSheet.Shapes("OctGB_Chart").ZOrder msoBringToFront
ActiveSheet.OctGB.BackColor = RGB(200, 210, 240)
ActiveSheet.OctGB.Font.Bold = True
ActiveSheet.OctGB.Font.Size = 10
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Is it in a UserForm? You could use the

VBA Code:
Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)

If not, you could create an image that is transparent behind the command button. For example, if the image was called "Transparent1" then you could do

VBA Code:
Private Sub Transparent1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
 
Upvote 0
Is it in a UserForm? You could use the

VBA Code:
Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)

If not, you could create an image that is transparent behind the command button. For example, if the image was called "Transparent1" then you could do

VBA Code:
Private Sub Transparent1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)

Thanks so much!
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top