Consulting

Results 1 to 3 of 3

Thread: Need macro to delete module content

  1. #1
    VBAX Newbie
    Joined
    May 2007
    Posts
    5
    Location

    Need macro to delete module content

    I am runnig a private sub to start a macro (Format) that formats and saves a file. After the file is saved, the private sub is still part of the new file and when it opens up, the formatting macro (Format) runs, messing everything up. Can I put some code in the private sub or the formatting macro (Format) to stop the private sub macro from running once I save the file as something else?

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Just add a test in the macro that will stop it running, say on some formatted cell.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    What application is this for....Word, Excel.....?

    I'm moving this to the excel forum for now until you tell me different. Try to post in the appropriate forum in future. Site and forum related does not seem to address your needs.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •