ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Create Macro Dynamically (https://www.excelbanter.com/excel-programming/355357-create-macro-dynamically.html)

klav

Create Macro Dynamically
 

When I open a spreadsheet, I want to create a macro dynamically and then
execute it. The code doesn't need to be saved.

How can I do this?


--
klav
------------------------------------------------------------------------
klav's Profile: http://www.excelforum.com/member.php...o&userid=17844
View this thread: http://www.excelforum.com/showthread...hreadid=519869


Niek Otten

Create Macro Dynamically
 
http://www.cpearson.com/excel/vbe.htm

--
Kind regards,

Niek Otten

"klav" wrote in message
...

When I open a spreadsheet, I want to create a macro dynamically and then
execute it. The code doesn't need to be saved.

How can I do this?


--
klav
------------------------------------------------------------------------
klav's Profile:
http://www.excelforum.com/member.php...o&userid=17844
View this thread: http://www.excelforum.com/showthread...hreadid=519869




Bob Phillips[_6_]

Create Macro Dynamically
 
It can be done, but it requires code to do it, so instead of having the
code-creation code, why not just store the code to be created. It's a lot
simpler.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"klav" wrote in message
...

When I open a spreadsheet, I want to create a macro dynamically and then
execute it. The code doesn't need to be saved.

How can I do this?


--
klav
------------------------------------------------------------------------
klav's Profile:

http://www.excelforum.com/member.php...o&userid=17844
View this thread: http://www.excelforum.com/showthread...hreadid=519869




Kassie

Create Macro Dynamically
 
You need to decide what you want the macro to do. In your workbook section
you then create an on open event, which will then run whenever you open the
file. For a macro to run, it needs to be recorded, (saved). It really makes
no sense to write a macro, run it, kill it and repeat this every time you
open a file!

"klav" wrote:


When I open a spreadsheet, I want to create a macro dynamically and then
execute it. The code doesn't need to be saved.

How can I do this?


--
klav
------------------------------------------------------------------------
klav's Profile: http://www.excelforum.com/member.php...o&userid=17844
View this thread: http://www.excelforum.com/showthread...hreadid=519869



Tim Williams

Create Macro Dynamically
 
If there's enough information to dynamically create a macro and run it then
you probably have what you need to carry out the same operations as the
"dynamic" macro without first having to create it...

What is the macro for ?

Tim

"klav" wrote in message
...

When I open a spreadsheet, I want to create a macro dynamically and then
execute it. The code doesn't need to be saved.

How can I do this?


--
klav
------------------------------------------------------------------------
klav's Profile:
http://www.excelforum.com/member.php...o&userid=17844
View this thread: http://www.excelforum.com/showthread...hreadid=519869





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

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