How do I open an Excel form via Ctrl+[some other key]
Hello,
I'm watching this great tutorial on how to create a Watch Window with VBA. The instructor says he's assigned Ctrl+W to open the form, but he doesn't explain how he did that. I have no idea how to open a form in Excel.
Ctrl+W doesn't open your form, it opens the Watch Window. If you'd like to know more about Debugging then you might want to read my Debugging article. It's aimed at VB6 but it's valid for VBA.
Frank Sellers
ASKER
Hello MartinLiss - Thanks for the info, but the instructor in the YouTube video says he's somehow assigned Ctrl+W to open his customized Watch Window in lieu of Excel's built-in Watch Window. I didn't even know Excel HAD a watch window (I'm far from an expert, which is why I need help) so that's good to know. Still, I like this cusomized Watch Window better than the standard one.
Martin Liss
Can you post a picture of the customized watch window?
If you look about 8:25 into the video, Bill shows the ShowForm routine he uses to show the actual Watch Box form. You simply need to assign a shortcut key to that as saqibh already indicated.
Frank Sellers
ASKER
Thanks for your info, rorya. How do I assign a shortcut key to this routine?
MartinLiss - Attached is a screen shot of my form. Nobody answering me so far seems to understand that I can't figure out how to open any form in Excel - it's like it's a big secret - let alone assign this opening command to a key combination. Excel-VBA-Watch-Window-Form.jpg
Martin Liss
ssaqibh's answer is correct and here's more explanation.
Create this macro
Sub Macro1()
frmWB.Show
End Sub
Then do Tools|Macro|Macros and you will see the screen on the left. Select the new macro, click Options and you can assign a letter in the screen on the right.
Frank Sellers
ASKER
Sorry I missed this solution before I continued seeking an answer. Thanks to everyone for your help - it works perfectly!