+ Reply to Thread
Results 1 to 3 of 3

Cancel VBA if WorkSheet name changes ( gets saved as )

  1. #1
    Registered User
    Join Date
    02-12-2005
    Posts
    19

    Cancel VBA if WorkSheet name changes ( gets saved as )

    I have an invoice put together in excel and I have a VBA code to update the date in the invoice, if that range is empty, and another code that updates the invoice number from a text file stored on the network.

    Everything works like a charm but when that master invoice get's saved as, the VBA goes with it. meaning if invoice 1004 gets saved, the next time it is opened it is invoice 1005. I don't want that to happen, I want it to stop running when the workbook name changes.

    Thanks, Im' stumped with this one.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Try this at the start of your VBA code (change Book1.xls to match your master workbook name)

    If ThisWorkbook.Name <> "Book1.xls" Then
    Exit Sub
    end if
    your code here

  3. #3
    Registered User
    Join Date
    02-12-2005
    Posts
    19

    Thanks Very Much

    That did the trick.

+ 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