Hello,
Debug.Print "TEXT" send/print "TEXT" to VBE immediate windowORfor x=1 to 100 'send/print 1 2 3 4 5 6 ....... 100 to VBE immediate windowdebug.print xnext
How can clear immediate window, using VBA code?Greetings!
Hello,I thank for Your answer!Below is my code to empty immediate window
Sub immediate_window_BhBp_clear()'CLEAR IMMEDIATE WINDOWSet WshShell = CreateObject("WScript.Shell")WshShell.SendKeys "^g^a{DEL}"End Sub
How to run code above.Place this code in any Macros moduleOpen VBEPress Ctrl-g 'to open immediate window
print "immediate" in immediate windowPress Ctrl-space 'drop down list with macros beginning with "immediate" appearsSelect necessary macro using mouse or arrows - immediate_window_BhBp_clearPress key EnterI see, that You use SendKeys "{Del}", TrueI don't understand why SendKeys "{Del}", True return error Permission deniedI am forced to use workaround code usingSet WshShell = CreateObject("WScript.Shell")WshShell.SendKeys "^g^a{DEL}" Greetings!