If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > VBA method to create dynamic Questionnaire

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-08-07, 08:56
JimFourleaf78 JimFourleaf78 is offline
Registered User
 
Join Date: Nov 2007
Posts: 11
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.
Reply With Quote
  #2 (permalink)  
Old 11-08-07, 09:05
shades shades is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 11-08-07, 09:13
JimFourleaf78 JimFourleaf78 is offline
Registered User
 
Join Date: Nov 2007
Posts: 11
Thanks - I'll give that book a go.
Reply With Quote
  #4 (permalink)  
Old 11-08-07, 09:21
shades shades is offline
Registered User
 
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
Reply With Quote
  #5 (permalink)  
Old 11-08-07, 11:49
JimFourleaf78 JimFourleaf78 is offline
Registered User
 
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?
Reply With Quote
  #6 (permalink)  
Old 11-08-07, 14:10
shades shades is offline
Registered User
 
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
Reply With Quote
  #7 (permalink)  
Old 11-09-07, 05:14
JimFourleaf78 JimFourleaf78 is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On