+ Reply to Thread
Results 1 to 11 of 11

Stopping user saving unless condition met.

  1. #1
    Registered User
    Join Date
    11-01-2007
    Posts
    14

    Stopping user saving unless condition met.

    Sorry to be back so soon.

    I am looking to stop the user saving the sheet if certain fields are not complete.

    The sheet has headers on line 4 and runs from A4 to M500

    In the M cells there is a counta function to check the records are complete.

    M4:M500 shows either

    Complete - All records comlpete
    Incomplete - something missing
    Blank - nothing entered yet.

    What i want to do is, if one of the cells in M shows incomplete not allow them to save the sheet until its complete.

    I tried the folowing (was my attempt to modify another post)


    Please Login or Register  to view this content.
    Any help appreciated.

    Thanks again.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    11-01-2007
    Posts
    14
    Quote Originally Posted by VBA Noob
    Maybe

    Please Login or Register  to view this content.
    VBA Noob

    Sorry think i may have not explained that as well as i could.

    when i say "blank" above the cell shows the word blank due to the following IF statement.

    Please Login or Register  to view this content.
    tried changing the code to
    Please Login or Register  to view this content.
    But sadly a little knowledge is dangerous and it didnt work!

    Is the problem the fact the M cells are the product of an IF statement?

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    Please Login or Register  to view this content.
    VBA Noob

  5. #5
    Registered User
    Join Date
    11-01-2007
    Posts
    14
    Quote Originally Posted by VBA Noob
    Maybe

    Please Login or Register  to view this content.
    VBA Noob

    Sadly no, still allows saving even tho there are a few "Incomplete" records.

    Thanks for your help tho.

    Is it allowed to post a dump of the screen to show my sheet?

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Attach a sample file would be better

    VBA Noob

  7. #7
    Registered User
    Join Date
    11-01-2007
    Posts
    14
    spi04x - asc - report_3sheet_gsearchpost.zip

    Thanks

    Its the ASC sheet tab.

    had to delete one of the tabs Complaint_ASC to make it fit so pls ignore any error due to that.

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try putting the code in Thisworkbook not the sheet tab

    VBA Noob

  9. #9
    Registered User
    Join Date
    11-01-2007
    Posts
    14
    Sorry about that! ive moved it but now get.

    Compile Error
    Variable not Defined

    and then it highlights

    msg =

    Sorry to be such a pain.

  10. #10
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    You have at the top of the code

    Please Login or Register  to view this content.
    This requires you too declare all variables.

    So declare the variable

    Please Login or Register  to view this content.
    VBA Noob

  11. #11
    Registered User
    Join Date
    11-01-2007
    Posts
    14
    done as you said and removed the line re "blank" and works perfectly

    Thanks VERY much four help, really apprecate it.

    And the fact you managed to remain patient!

    Please Login or Register  to view this content.

+ 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