0

I wish I could add the Immediate window to the bottom of my normal Excel window, without having to have the Visual Basic Editor open.

Is there any way instead, to get a code from an inputbox, and run it in the Immediate window? Or anything similar?

I tried to test that by using the following VBA:

Sub RunCustomCommand()
Inp = InputBox("What would you like to run in the console?", "Quick-Run Code")
Debug.Print Inp
End Sub

However, this only caused the code to print into the immediate window, and didn't run until I clicked into it and ran it myself.

I'm commonly wanting to run short codes, but not necessarily needing to write a whole macro, or wanting to need to go into the Visual Basic Editor at all. If anyone has any other ideas on how I could run a quick line of code into Excel, I would appreciate any solution!

braX
  • 11,506
  • 5
  • 20
  • 33
Andy L
  • 93
  • 6
  • There's no Eval/Exec for VBA code, so if you wanted to do this you'd need to look at something like: http://www.cpearson.com/excel/vbe.aspx – Tim Williams Mar 15 '23 at 20:00

0 Answers0