+ Reply to Thread
Results 1 to 4 of 4

Problem trying to make sure there is not a 1 in a range of cells

  1. #1
    Registered User
    Join Date
    08-30-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    30

    Problem trying to make sure there is not a 1 in a range of cells

    Hi

    I want to check a small range of cells to make sure there is not a 1 in them.
    If there is a 1, then the workbook, does not save and they need to complete the sheet.
    If there is not a 1, then the workbook saves etc...

    My effort below which keeps bringing up the msgbox!!!

    Please Login or Register  to view this content.
    Thanks

    Ronan

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Problem trying to make sure there is not a 1 in a range of cells

    After the msgbox line, add
    Please Login or Register  to view this content.

  3. #3
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Problem trying to make sure there is not a 1 in a range of cells

    You could also use COUNTIF rather than looping:

    Please Login or Register  to view this content.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  4. #4
    Registered User
    Join Date
    08-30-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Problem trying to make sure there is not a 1 in a range of cells

    Wow. Arrgh Exit Sub... of course... Thanks. I'll go with the Count too..

    thanks

+ 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