Running Code

W

Wavequation

I would like to run some code, but I don't necessarily need it to be
associated with a form. Is there a way to run code from the VBA editor
window?
Thanks!
 
W

Wavequation

What I really want to do is open up some recordsets and manipulate the data
in them. Can I run entire blocks of code without associating it with an
event of some sort?
 
D

Douglas J. Steele

Not really.

What I do is create a sub to do what I want in a stand-alone module, then
either run the sub from the Immediate Window, or else single-step through
it.
 
J

John W. Vinson

How do you run it in the immediate window, just type its name?

For a function, type

=Functionname(arguments)

For a sub, type

Call subname(arguments)
 
M

Michael J. Strickland

1. Put the code in a stand-alone module

2. Compile it (Debug->Compile).

3. Position the cursor anywhere inside the code, and hit F5(Run).
 

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

Top