+ Reply to Thread
Results 1 to 3 of 3

Encountered another Check Cell Problem

  1. #1
    Forum Contributor
    Join Date
    05-09-2005
    Location
    SC
    Posts
    196

    Encountered another Check Cell Problem

    Hello Again,

    Maybe I should have stated earlier that I'm actually checking 5 groups of 2 cells (if that makes since). The code should check A1 & B1, then A2 & B2, A3 & B3...

    What happens is that if A1 has data, but B1 doesn't. The code returns the 1st error message as expected, butwhen the ok button is pushed on the 1st message it goes to the next successful message, which I don't want it to do until all cell conditions are true.

    Here's the code for just 2 of the 5 groups needed:

    Sub Check_click()

    If Range("A1").Value <> "" And Range("B1").Value = "" Then
    MsgBox "You must select a code in Special Purpose Deposits. Click the arrow to select General or Building!", 16, "message"
    Range("B1").Select
    End If

    If Range("A2").Value <> "" And Range("B2").Value = "" Then
    MsgBox "You must select a code in Special Purpose Deposits. Click the arrow to select General or Building!", 16, "message"
    Range("B2").Select

    Else
    MsgBox "Check Sheet is Successful. Go to step 5!", 64, "message"
    End If

    End Sub

    Thanks Again,
    EMoe

  2. #2
    Forum Contributor
    Join Date
    11-09-2004
    Posts
    451
    Sub Check_click()

    If Range("A1").Value <> "" And Range("B1").Value = "" Then
    MsgBox "You must select a code in Special Purpose Deposits. Click the arrow to select General or Building!", 16, "message"
    Range("B1").Select
    elseIf Range("A2").Value <> "" And Range("B2").Value = "" Then
    MsgBox "You must select a code in Special Purpose Deposits. Click the arrow to select General or Building!", 16, "message"
    Range("B2").Select
    Else
    MsgBox "Check Sheet is Successful. Go to step 5!", 64, "message"
    End If

    End Sub

  3. #3
    Forum Contributor
    Join Date
    05-09-2005
    Location
    SC
    Posts
    196
    You are excellent!

    Thanks a million. It works like a charm.

    Regards,
    EMoe

+ 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