+ Reply to Thread
Results 1 to 2 of 2

VBA Help Please

  1. #1
    Registered User
    Join Date
    03-02-2011
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    4

    Exclamation VBA Help Please

    Circumstances:
    Shared workbook on a server being used as a dispatch board. This is updated by at least two people at a time - hardly ever more than that (and they sit right next to each other). I have a VBA code inserted as a Macro into the workbook that automatically saves the workbook every minute so that everyone can see the changes made and will not have to press the Save button every time they make a change because people forget and then a big mess is made.The code is below.

    Dim NextTime As Date

    Sub Auto_Open()
    NextTime = Now + TimeValue("0:05:00") ' in 5 minutes
    Application.OnTime NextTime, "SaveMe"
    End Sub

    Sub SaveMe()
    ThisWorkbook.Save
    NextTime = Now + TimeValue("0:05:00") ' in 5 minutes
    Application.OnTime NextTime, "SaveMe"
    End Sub

    Sub Auto_Close()
    If NextTime <> 0 Then
    Application.OnTime NextTime, "SaveMe", schedule:=False
    NextTime = 0
    End If
    End Sub
    What I want to add to this is a way to possibly make this run in the background for the dispatch board workbook only. We work in several different excel workbooks at a time on a daily basis and any time we have the dispatch board workbook open it saves the other workbooks that are open as well. We do not want this to occur, we would only like the Dispatch board workbook to be saved.

    I don't know much about writing VBA code, but I can understand it as I've taken some Java courses and fooled around with PHP/MySQL.

    Any help would be appreciated, thank you!

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: VBA Help Please

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    PLEASE PM WHEN YOU HAVE DONE THIS AND I WILL DELETE THIS POST

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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