Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2007
    Posts
    11

    Unanswered: VBA method to create dynamic Questionnaire

    Hi,

    Can anybody give me some advise as to what is the best method to generate a dynamic questionnaire/survey in Excel using VBA or point me in a good direction as to where I will be able to find similar examples on the web.

    This is what I need to acheive and have already been able to implement:

    I have used VBA code to connect to my external database and draw down the information for each survey so that each survey is presented is a seperate worksheet listing the question numbers, question and percentage worth values.

    What I am failing to understand is to how I would be able to generate a radio button for each question and also how I would be able to validate the radios. Another main function that I will need to provide is the ability to draw back the results from each of the surveys (in each worksheet) and tie them together to create a barchart of results.

    To achieve these goal am I best to create worksheets or create forms from within the VBA environment?

    Can anybody help out here and put me on track.

    Appreciate all comments.

  2. #2
    Join Date
    Oct 2003
    Posts
    1,091
    Howdy. Sounds like maybe designing your own UserForm would give you most of what you want - you could use radio buttons or check boxes. By going this route you will have built in ways of referring to the data, and can pull it directly into a summary. This also gives you the best control over the user experience.

    As for the summary, you could design it to put into another hidden worksheet, then use code to create a Pivot Table, or whatever else you might find best for your needs.

    An excellent resource for all of this is the book VBA and Macros for Microsoft Excel by Bill Jelen [MrExcel], et al. The book provides code for UserForms and Pivot Tables, and then gives advice on best practices.
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  3. #3
    Join Date
    Nov 2007
    Posts
    11
    Thanks - I'll give that book a go.

  4. #4
    Join Date
    Oct 2003
    Posts
    1,091
    BTW, the chapter on Pivot Tables itself is worth the price of the book.
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  5. #5
    Join Date
    Nov 2007
    Posts
    11
    Do you know if I can use the Visual Basic Application tool in excel to do all of this work or if I require a version of VB?

    I am getting several issues when I try to create a VBProject object as it is not recognised in the Object properties list. I have looked this up on the internet @

    http://www.cpearson.com/excel/MissingReferences.aspx

    however I have all of the components except the registryworx dl and can not locate it - is that needed?

  6. #6
    Join Date
    Oct 2003
    Posts
    1,091
    You can do it all in VBA.
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  7. #7
    Join Date
    Nov 2007
    Posts
    11
    Hi - I have just found out that I didnt have one of the references needed.

    I needed to check the Microsoft Visual Basic for Application Extensibility 5.3 checked. Also after that I had another problem with a runtime 1004 error.

    For anybody that experiences this problem goto this link to solve.

    http://www.microsoft.com/communities...0e7b16e53d&p=1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •