ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Initiating the VBA program (https://www.excelbanter.com/excel-programming/429752-re-initiating-vba-program.html)

Rick Rothstein

Initiating the VBA program
 
Which code window did you copy/paste it into? Normally, you would put it
into a Module (Insert/Module from the VB menu bar), but this would require
the code to reference the worksheets that any ranges are on (otherwise the
active sheet would be used by default and that may not be what you want or
need). If you put it in a worksheet module, then that worksheet would have
to be active in order for the macro to have any unspecified ranges refer to
it. Assuming you have the code in the correct place, you can get to it by
pressing Alt+F8. After pressing Alt+F8, you can select the macro and run it
directly OR you can click the Options button on the dialog box and assign a
keystroke combination to run it from the dialog box that appears.

--
Rick (MVP - Excel)


"Dino" wrote in message
...
Hi, this is a very basic question: I found a VBA program here that I think
might help solve my problem, but once I copy and paste the code into the
code
window, how do I make the program run? When I create a macro, I give the
macro a keystroke combination to run, but when I create/copy a VBA program
I
don't know how to start the code running once I get back to the
spreadsheet.

Thanks to anyone who can help,
Dino




All times are GMT +1. The time now is 12:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com