Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamically create userform michael v Excel Programming 0 February 13th 06 07:56 PM
dynamically create userform Janelle Excel Programming 7 December 17th 04 04:47 PM
Create combo box dynamically Duraiswamy Lingappan Excel Programming 9 July 8th 04 05:09 PM
Can we create pivot table dynamically priya Excel Programming 2 June 22nd 04 01:26 PM
Create controls dynamically Tom Ogilvy Excel Programming 0 November 24th 03 03:37 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"