+ Reply to Thread
Results 1 to 7 of 7

Erase Code

Hybrid View

  1. #1
    Todd Huttenstine
    Guest

    Erase Code

    You can write an if statement at the beginning of your
    code to say something like:

    If ActiveWorkbook.Name <> "YourWorkbookName.xls" Then
    'Code Here
    Else
    'Other condition code here
    End If

    You can use = or <>.

    This way when you change the name of the file, the code
    will not run the next time because the workbook name has
    changed. Im not sure if leaving this code in the workbook
    is exactly what you want, but the reults will be to where
    the code will not run.


    Todd


    >-----Original Message-----
    >I have a spreadsheet that runs code when it opens to

    populate the data. I
    >need it to automatically erase the code once complete so

    that when I save the
    >workbook with a new name; the code does not rerun when

    management opens the
    >workbook to view the data.
    >.
    >


  2. #2
    Bill Linker
    Guest

    RE: Erase Code

    Would it be an option to have the code in another file and just manually
    start running your program on the main file? or keep the code in the file,
    but copy the resultant data over to a new file after your data processing
    program completes?

    "Todd Huttenstine" wrote:

    > You can write an if statement at the beginning of your
    > code to say something like:
    >
    > If ActiveWorkbook.Name <> "YourWorkbookName.xls" Then
    > 'Code Here
    > Else
    > 'Other condition code here
    > End If
    >
    > You can use = or <>.
    >
    > This way when you change the name of the file, the code
    > will not run the next time because the workbook name has
    > changed. Im not sure if leaving this code in the workbook
    > is exactly what you want, but the reults will be to where
    > the code will not run.
    >
    >
    > Todd
    >
    >
    > >-----Original Message-----
    > >I have a spreadsheet that runs code when it opens to

    > populate the data. I
    > >need it to automatically erase the code once complete so

    > that when I save the
    > >workbook with a new name; the code does not rerun when

    > management opens the
    > >workbook to view the data.
    > >.
    > >

    >


+ 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