about ctrl+g in vbe

  • Thread starter Thread starter tom taol
  • Start date Start date
T

tom taol

i want to clear the texts after ctrl+g in vbe.
for example
debug.print 3
debug.print 3
debug.print 7


and then
debugWnd.clear this syntax....
 
I believe this has come up before, and the answer was there is no way to
programmatically clear the immediate pane. Easiest way to clear it is to
place the cursor in the immediate pane, press Ctrl-a, then press Delete.
James
 
I think someone came up with a suggestion, but sometimes it crashed excel
(IIRC).

Maybe just doing something like:

Option Explicit
Sub testme01()
Dim iCtr As Long
For iCtr = 1 To 1000
Debug.Print
Next iCtr
End Sub

would be enough for the OP.
 
MZ Tools (www.mztools.com) seems to do it programmatically, but I don't know
how it works. I tried subclassing the Immediate window using SPY++ to see
what messages it was receiving, but I never got the right messages. This is
but one of many very nice tools that are supplied by MZ Tools; it is a good
add-in for any serious VB/VBA/NET programmer.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 
I'm not sure if I remembered correctly. I think that the problem with one
suggestion (a long time ago) was that it used sendkeys to try to clear that
immediate window. And sometimes, it would clear the data on a worksheet. (It
may not have anything to do with crashing excel.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top