+ Reply to Thread
Results 1 to 4 of 4

Macro

  1. #1
    holy41
    Guest

    Macro

    How can i stop a workbook from running if i put main formulas in a macro of
    the workbook so if some one disable the macros workbook won't run?
    How do i write the code for Cell B6,G6:G61,J6,K6,L6.M6?

    Thank Ken Calhoun

  2. #2
    Tom Ogilvy
    Guest

    RE: Macro

    if the formulas don't exist unless the macro runs, then it shouldn't be a
    problem. Of course, you would need to remove them when the workbook is
    closed (and save the workbook after removing and before closing).

    http://www.cpearson.com/excel/events.htm (for information on events such as
    the workbook Open, BeforeSave, BeforeClose events.

    Write the code to do what? saying "or Cell B6,G6:G61,J6,K6,L6.M6?" is
    meainingless

    if you wanted to sum B1:B5 in cell B6 your could

    Range("B6").Value = Application.sum(Range("B1:B5"))
    or to put in a formula
    Range("B6").Formula = "=Sum(B1:B5)"

    those are just examples of course. Not way to know what you actually want
    to do.


    All that said, trying to protect your workbook with code is usually pretty
    easily defeated.
    --
    Regards,
    Tom Ogilvy


    "holy41" wrote:

    > How can i stop a workbook from running if i put main formulas in a macro of
    > the workbook so if some one disable the macros workbook won't run?
    > How do i write the code for Cell B6,G6:G61,J6,K6,L6.M6?
    >
    > Thank Ken Calhoun


  3. #3
    Tom Ogilvy
    Guest

    RE: Macro

    if the formulas don't exist unless the macro runs, then it shouldn't be a
    problem. Of course, you would need to remove them when the workbook is
    closed (and save the workbook after removing and before closing).

    http://www.cpearson.com/excel/events.htm (for information on events such as
    the workbook Open, BeforeSave, BeforeClose events.

    Write the code to do what? saying "or Cell B6,G6:G61,J6,K6,L6.M6?" is
    meainingless

    if you wanted to sum B1:B5 in cell B6 your could

    Range("B6").Value = Application.sum(Range("B1:B5"))
    or to put in a formula
    Range("B6").Formula = "=Sum(B1:B5)"

    those are just examples of course. Not way to know what you actually want
    to do.


    All that said, trying to protect your workbook with code is usually pretty
    easily defeated.
    --
    Regards,
    Tom Ogilvy


    "holy41" wrote:

    > How can i stop a workbook from running if i put main formulas in a macro of
    > the workbook so if some one disable the macros workbook won't run?
    > How do i write the code for Cell B6,G6:G61,J6,K6,L6.M6?
    >
    > Thank Ken Calhoun


  4. #4
    holy41
    Guest

    RE: Macro

    Thank Ken
    The code work . But if i save the program they are saved in cells. So Could
    you help me with the clearing the cell and then savieing to the the
    workbook. I apperciate your help verry mutch. Thank Ken

    "Tom Ogilvy" wrote:

    > if the formulas don't exist unless the macro runs, then it shouldn't be a
    > problem. Of course, you would need to remove them when the workbook is
    > closed (and save the workbook after removing and before closing).
    >
    > http://www.cpearson.com/excel/events.htm (for information on events such as
    > the workbook Open, BeforeSave, BeforeClose events.
    >
    > Write the code to do what? saying "or Cell B6,G6:G61,J6,K6,L6.M6?" is
    > meainingless
    >
    > if you wanted to sum B1:B5 in cell B6 your could
    >
    > Range("B6").Value = Application.sum(Range("B1:B5"))
    > or to put in a formula
    > Range("B6").Formula = "=Sum(B1:B5)"
    >
    > those are just examples of course. Not way to know what you actually want
    > to do.
    >
    >
    > All that said, trying to protect your workbook with code is usually pretty
    > easily defeated.
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "holy41" wrote:
    >
    > > How can i stop a workbook from running if i put main formulas in a macro of
    > > the workbook so if some one disable the macros workbook won't run?
    > > How do i write the code for Cell B6,G6:G61,J6,K6,L6.M6?
    > >
    > > Thank Ken Calhoun


+ 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