locked
VBA to clear the Immediate Window RRS feed

  • Question

  •  

    When developing a macro I often use Debug.Print to show results in the immediate window and then have to manualy delete the contents of the immediate window between executions of the macro.  Is there a VBA action to delete the contents of the immediate window? 

    Sunday, November 28, 2010 3:55 PM

Answers

  • 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
    If this answer solves your problem, please check Mark as Answered. If this answer helps, please click the Vote as Helpful button. Cheers, Rajender Saini Aditi Enterprise Solutions – Partnering Innovation | www.aditi.com
    • Marked as answer by Steve Staab Monday, November 29, 2010 3:11 AM
    Sunday, November 28, 2010 5:21 PM

All replies

  • 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
    If this answer solves your problem, please check Mark as Answered. If this answer helps, please click the Vote as Helpful button. Cheers, Rajender Saini Aditi Enterprise Solutions – Partnering Innovation | www.aditi.com
    • Marked as answer by Steve Staab Monday, November 29, 2010 3:11 AM
    Sunday, November 28, 2010 5:21 PM
  • It's perfect. Thanks Rajendersaini.

    Thursday, February 23, 2012 4:39 AM
  • very helpful. Thanks

    Monday, December 7, 2020 8:54 AM