Use VBA to Clear Immediate Window?

Alpha picture Alpha · Apr 18, 2012 · Viewed 100.5k times · Source

Does anyone know how to clear the immediate window using VBA?

While I can always clear it myself manually, I am curious if there is a way to do this programmatically.

Answer

Blaz Brencic picture Blaz Brencic · Jun 20, 2012

Below is a solution from here

Sub stance()
Dim x As Long

For x = 1 To 10    
    Debug.Print x
Next

Debug.Print Now
Application.SendKeys "^g ^a {DEL}"    
End Sub