+ Reply to Thread
Results 1 to 11 of 11

after msgbox go to not answered groupbox (radiobutons) before continu with next macro

  1. #1
    Registered User
    Join Date
    01-08-2012
    Location
    Zwijndrecht, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    20

    after msgbox go to not answered groupbox (radiobutons) before continu with next macro

    Hi there,

    I'm new here and not very familiair with VBA.
    I've searched on the internet for many days but can't find to solve my problem.

    I've an Excel Workbook with several sheets.
    A sheet named "Vragenlijst" contains 20 questions. Each question has 4 option buttons (Control Toolbox) in a group.

    In the second sheet named "Controlevelden" the values of the 20 aswers are registered in colom B2 to B21.
    In B27 i wrote a formula: =COUNT.IF(B2:B21;">0")>=20

    After the questions are aswered there will be a summary of textual answers on the sheet named "Rapportage".

    I have 1 command button proceeding all the actions neccesary. After pushing the button
    a macro takes a picture (with 'camera'-option in Excel) of this summary and places it on a special place on sheet "Vragenlijst"

    A MsgBox is giving me a box with "You didn't anwer 1 (or more) questions" when a question has not been answers (option button not chosen). When all the question are answered: "You answered all the question".

    The problem is that after "You didn't asnwer 1 (or more) questions" it continues with the next macro in VBA.
    I want to go to the not answered question before going further with the VBA command.

    The command button has this code:

    Please Login or Register  to view this content.
    the module (sub) 'checkvragen' has this code:
    Please Login or Register  to view this content.
    Can anyone help me please?
    Last edited by VBAStarter; 01-22-2012 at 11:14 AM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: after msgbox go to not answered groupbox (radiobutons) before continu with next m

    hi VBAStarter


    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    01-08-2012
    Location
    Zwijndrecht, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: after msgbox go to not answered groupbox (radiobutons) before continu with next m

    Hi Pike,

    thanks a lot for your quick reaction!
    I've copied the code under the command button as you mentioned.

    So far it stops the action for going further and gives me the oportunity to fill in the answer(s). After that it gives me the msgbox "You answered all the question". But after that pressing the command button gives no further action.

    ..So a bit further in the proces... but not towards the finish!

    Maybe you (or others) have more ideas to come further.

    Thanks for responding!

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: after msgbox go to not answered groupbox (radiobutons) before continu with next m

    can you attach the workbook?

  5. #5
    Registered User
    Join Date
    01-08-2012
    Location
    Zwijndrecht, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: after msgbox go to not answered groupbox (radiobutons) before continu with next m

    Hi Pike,

    here is the workbook you were asking for.

    Greetz,
    VBA Starter
    Last edited by VBAStarter; 01-22-2012 at 10:56 AM.

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: after msgbox go to not answered groupbox (radiobutons) before continu with next m

    have i got the true and false around the wrong way?
    try....
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-08-2012
    Location
    Zwijndrecht, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: after msgbox go to not answered groupbox (radiobutons) before continu with next m

    Hi Pike,

    you made my day!
    Yes, I had to change the TRUE en FALSE status and everything went perfect!

    Maybe i've to come back to you because now i'm gonna try to work with secured sheets and workbook, so nobody can change the workbook without permission.
    If this will work fine, my problem is solved. In that case I'll close this isssue.

    For so far...many thanks for your help. Without you it would be a tremendous struggle for an amateur like me!

  8. #8
    Registered User
    Join Date
    01-08-2012
    Location
    Zwijndrecht, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: after msgbox go to not answered groupbox (radiobutons) before continu with next m

    Something is going wrong when i secure the page 'Vragenlijst' (password protected with only 'Select unlocked cells' checked).

    The first part of the command (check of answered questions) takes place. The macro 'foto' gives a Run-time error "1004", with 'unable to get the Past proprety of the Pictures class' . I've tried different protection settings but none of them helped me.
    What is the problem en how can I solve this?

  9. #9
    Registered User
    Join Date
    01-08-2012
    Location
    Zwijndrecht, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: after msgbox go to not answered groupbox (radiobutons) before continu with next m

    extra information: in VBA 'ActiveSheet.Pictures.Paste.Select' is highlighted in yellow, so this action won't take place.
    Last edited by VBAStarter; 01-21-2012 at 02:21 PM.

  10. #10
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: after msgbox go to not answered groupbox (radiobutons) before continu with next m

    Hi
    You will need to unprotect the sheet before you run the macro then protect after it has run

  11. #11
    Registered User
    Join Date
    01-08-2012
    Location
    Zwijndrecht, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: after msgbox go to not answered groupbox (radiobutons) before continu with next m

    Hello Pike,

    this method didn't work for me. Only when i selected 'Edit Objects' in sheetprotection, this would work. But then all the other object were unprotected.

    I found out on the internet the following code
    Please Login or Register  to view this content.
    . This works fine for me. I placed it in a module and add it to the commandbutton.

    Thanks for all the good ideas!
    Last edited by VBAStarter; 01-22-2012 at 10:44 AM.

+ 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