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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
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,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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