+ Reply to Thread
Results 1 to 8 of 8

Thread: Situation where all data must be entered.

  1. #1
    Registered User
    Join Date
    09-18-2009
    Location
    Trinidad
    MS-Off Ver
    Excel 2007
    Posts
    53

    Situation where all data must be entered.

    Given: cells A1:A10 has a value/text.

    Formula written in A11....=if(countif(A1:A10)>0;"yes";"no"). *This is basically an "alert" to say that all cells have been filled.

    I would like to write this format into VBA, except in place of "no", I would like a pop-up message informing me that information is missing.

    Any help would be greatly appreciated.
    My brain craves knowledge and Monster.

  2. #2
    Valued Forum Contributor
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    895

    Re: Situation where all data must be entered.

    try code:

    Sub aa()
    Dim myrange As Range
    
    Set myrange = Range("a1:a10")
    If Application.WorksheetFunction.CountA(myrange) < 10 Then
    MsgBox "there are empty cells"
    End If
    End Sub
    or maybe this in sheet module
    Private Sub Worksheet_Change(ByVal Target As Range)
    Set Target = Range("a1:a10")
    If Application.WorksheetFunction.CountA(Target) < 10 Then
    MsgBox "there are empty cells"
    End If
    End Sub
    Last edited by tom1977; 12-08-2011 at 03:55 PM.
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  3. #3
    Registered User
    Join Date
    09-18-2009
    Location
    Trinidad
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Situation where all data must be entered.

    Can't seem to run it. *confused*
    Attached Files Attached Files
    My brain craves knowledge and Monster.

  4. #4
    Valued Forum Contributor
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    895

    Re: Situation where all data must be entered.

    try this in attachment
    Attached Files Attached Files
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  5. #5
    Registered User
    Join Date
    09-18-2009
    Location
    Trinidad
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Situation where all data must be entered.

    ok. I see it got working.

    But what did I do wrong?
    My brain craves knowledge and Monster.

  6. #6
    Valued Forum Contributor
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    895

    Re: Situation where all data must be entered.

    In your attachment there is any code
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  7. #7
    Registered User
    Join Date
    09-18-2009
    Location
    Trinidad
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Situation where all data must be entered.

    oh. okkk. i thought it was attached *hmmmm*
    My brain craves knowledge and Monster.

  8. #8
    Registered User
    Join Date
    09-18-2009
    Location
    Trinidad
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Situation where all data must be entered.

    ok, after a week of delay, I'm finally settling down to thoroughly try out this macro.

    It works ok, but I wish that when i start filling out the cells, the popup message comes up every time I hit enter after each cell.

    I would like it to operate as if you're filling out a online form.

    Is this possible?
    My brain craves knowledge and Monster.

+ 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.2.0