+ Reply to Thread
Results 1 to 5 of 5

VBA code auto load and auto closing

  1. #1
    Registered User
    Join Date
    09-11-2008
    Location
    malta
    Posts
    34

    VBA code auto load and auto closing

    I have put the following code in a module in a workbook of 6 worksheets but with only 2 worksheets showing. Worksheets need to be protected. As soon as user clicks opens the file, it opens immediately, adds one to the qtn number and closes immediately saving a new file with the new qtn number. What i wish the code to do is that when user opens the file it opens up, but then stays open until user input new data, and then when user clicks a button the new qtn file with the incremented qtn number is created and saved.

    Please Login or Register  to view this content.
    Can someone indicate what I am doing wrong and how should the code be to have it doing what I need it to do.

    Thks
    Paraxis
    Last edited by paraxis; 11-21-2008 at 02:45 PM. Reason: By mistake I made title as Solved but IT Is not Solved

  2. #2
    Registered User
    Join Date
    09-11-2008
    Location
    malta
    Posts
    34

    I wish to set a template

    Hello,
    With my last message, I would like to use the code to make a template so that each time the master template is opened it will get the next number to qtn number. So I need to have a file where to hold the numeric counter. How do I do this please?
    Sorry about this but my VB experience is very limited indeed.
    10x
    Paraxis

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    can you attach the workbook, and stick to one question at a time.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    09-11-2008
    Location
    malta
    Posts
    34
    Hello Roy
    My workbook is attached.

    10x
    Attached Files Attached Files

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    The code needs to be tidied up, you don't need to select the ranges. The clearcontents could be done with an array.

    I would store he number in the Registry.

+ 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