+ Reply to Thread
Results 1 to 10 of 10

Is there a VBA fiddle?

  1. #1
    Registered User
    Join Date
    12-31-2013
    Location
    #VALUE
    MS-Off Ver
    2016
    Posts
    27

    Is there a VBA fiddle?

    I'm looking for a scratchpad to throw code in and see if it works. Something like dotnetfiddle.net but for VBA.

  2. #2
    Forum Contributor
    Join Date
    06-12-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    167

    Re: Is there a VBA fiddle?

    if you press f8 you can step through the code or select a line and press f9 to set a breakpoint. Not sure if that helps but its what I do to test code

  3. #3
    Registered User
    Join Date
    12-31-2013
    Location
    #VALUE
    MS-Off Ver
    2016
    Posts
    27

    Re: Is there a VBA fiddle?

    Doing that already.

    Testing this code atm.
    Please Login or Register  to view this content.
    Last edited by Look, More, What; 07-14-2017 at 11:46 AM. Reason: Fixed it

  4. #4
    Registered User
    Join Date
    08-08-2014
    Location
    Lancaster, PA
    MS-Off Ver
    2016 (windows & mac)
    Posts
    94

    Re: Is there a VBA fiddle?

    I usually create my own scratchpad Sub at the end of the code module where I try out stuff, I call mine Foo()

    typically it's where I'll create small sections of code or try things out for the first time. it's usually littered with multiple Debug.Print lines so I can see results as I step through, or I use the locals window.

    I make sure it never outputs results to the workbook so I'm never in danger of messing up any of the 'live' data. I use it work through logic and also throw in edge cases etc to ensure it's behaving as needed before I deploy it into the main workbook code.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Is there a VBA fiddle?

    You know you can run code from the Immediate window?

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Is there a VBA fiddle?

    You can get a little complicated with the Immediate Window

    Please Login or Register  to view this content.
    OK - so it's nonsensical but just to illustrate iterating a Do or For loop

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Is there a VBA fiddle?

    I keep a workbook with all the code I've written, it's now got 97 sheets that get used and reused for different tasks
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  8. #8
    Registered User
    Join Date
    12-31-2013
    Location
    #VALUE
    MS-Off Ver
    2016
    Posts
    27

    Re: Is there a VBA fiddle?

    I will start using this Immediate Window.

    Wow.... 97 sheets... I don't think you can call that a workbook anymore.

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Is there a VBA fiddle?

    Playbook?????

  10. #10
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Is there a VBA fiddle?

    ... will start using this Immediate Window
    Just bear in mind you are limited to statements on 1 line only... To really check out code add it as a Public Sub to a scratch module and call it from the Immediate Window or, if the procedure does not take any parameters, click the mouse anywhere in the procedure body and press F8 to start single stepping or F5 to just run it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1