+ Reply to Thread
Results 1 to 5 of 5

Create Macro Dynamically

Hybrid View

  1. #1
    Registered User
    Join Date
    12-29-2004
    Posts
    1

    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?

  2. #2
    Niek Otten
    Guest

    Re: Create Macro Dynamically

    http://www.cpearson.com/excel/vbe.htm

    --
    Kind regards,

    Niek Otten

    "klav" <klav.24bf9y_1141761606.8773@excelforum-nospam.com> wrote in message
    news:klav.24bf9y_1141761606.8773@excelforum-nospam.com...
    >
    > 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. #3
    Bob Phillips
    Guest

    Re: 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" <klav.24bf9y_1141761606.8773@excelforum-nospam.com> wrote in message
    news:klav.24bf9y_1141761606.8773@excelforum-nospam.com...
    >
    > 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. #4
    Kassie
    Guest

    RE: 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. #5
    Tim Williams
    Guest

    Re: 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" <klav.24bf9y_1141761606.8773@excelforum-nospam.com> wrote in message
    news:klav.24bf9y_1141761606.8773@excelforum-nospam.com...
    >
    > 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 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