Macro wont Run with shorts

toughie

New Member
Joined
Oct 10, 2018
Messages
43
I have a userform open and my Application.visible = False on start up,

i want to add a macro that will
Application.visible = True with assigned shortcut Ctrl+Shift+Z

it currently does not work and have ran out of ideas, any help is appreciated?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Are you sure that it is even possible to do that?

A different approach - UserForm doubleClick event
Code:
Private Sub UserForm_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    Application.Visible = True
End Sub
or toggle like this - you may need to use {Tab} to find the userform if it disappears :warning:
Code:
Private Sub UserForm_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    With Application
        .Visible = Not .Visible
    End With
End Sub
restrict to specific user?
Code:
Private Sub UserForm_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    If Application.UserName = "ABC" Then
        Application.Visible = True
    Else
        Cancel = True
    End If
End Sub
What is your Excel user name?
Code:
MsgBox Application.UserName
 
Last edited:
Upvote 0
Yeah i wasnt sure if it was possible but this approach will be better, im unsure what my excel username is or where to find it?
 
Upvote 0
I'm unsure what my excel username is or where to find it?

That is why I gave you the last line of code in post#2

Code:
MsgBox Application.UserName
 
Upvote 0
Solution

Forum statistics

Threads
1,223,892
Messages
6,175,236
Members
452,621
Latest member
Laura_PinksBTHFT

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