PC Review


Reply
Thread Tools Rate Thread

Display data from a cell in User Form

 
 
Connie
Guest
Posts: n/a
 
      13th Nov 2008
I have a spreadsheet with the numbers 1-100 in column A. Column B
contains exam questions in rows 1-100. I would like to create a user
form that will display the questions one at a time to my students and
allow them to enter an answer selection (A, B, C, or D). That answer
will be stored on another tab for scoring. I would also like the
studentgs to be able to navigate forward and backwards (in case they
want to go back and change an answer to a previously answered
question). I know this has to be simple, but I'm having trouble
getting started. I've created other applications using Excel. I'm
not sure if a user form is the way to go or not. Could someone
please
point me in the right direction to get started? I would really
appreciate it. Thanks.
 
Reply With Quote
 
 
 
 
John Bundy
Guest
Posts: n/a
 
      13th Nov 2008
Of course you will have to do some adjustments but this should get you most
of the way there. I created a userform with a textbox for the question, 4
optionbuttons label A,B,C,D a commandbutton, and a spinbutton. If the
questions are in column A, then when you load, the question in Row 1 appears
in the textbox, use the up and down on the spinbutton to change selections (i
handled the error going back before question one, you will have to maintain
when to stop). When they click the commandbutton, it writes to a second sheet
named "Answers" the option they chose. So if the choose B for the question in
row 3, then on the "Answer" sheet you will see a B in row 3.


Dim question As Integer
Dim answer As String
Private Sub CommandButton1_Click()
Sheets("Answers").Cells(question, 1) = answer
End Sub

Private Sub OptionButton1_Click()
answer = "A"
End Sub

Private Sub OptionButton2_Click()
answer = "B"
End Sub

Private Sub OptionButton3_Click()
answer = "C"
End Sub

Private Sub OptionButton4_Click()
answer = "D"
End Sub

Private Sub SpinButton1_SpinDown()
If question > 1 Then question = question - 1
updateTextbox
End Sub

Private Sub SpinButton1_SpinUp()
question = question + 1
updateTextbox
End Sub

Private Sub updateTextbox()

TextBox1.Text = Sheets(1).Cells(question, 1)
End Sub

Private Sub UserForm_Activate()
question = 1
TextBox1.Text = Sheets(1).Cells(question, 1)
End Sub

--
-John http://jmbundy.blogspot.com
Please rate when your question is answered to help us and others know what
is helpful.


"Connie" wrote:

> I have a spreadsheet with the numbers 1-100 in column A. Column B
> contains exam questions in rows 1-100. I would like to create a user
> form that will display the questions one at a time to my students and
> allow them to enter an answer selection (A, B, C, or D). That answer
> will be stored on another tab for scoring. I would also like the
> studentgs to be able to navigate forward and backwards (in case they
> want to go back and change an answer to a previously answered
> question). I know this has to be simple, but I'm having trouble
> getting started. I've created other applications using Excel. I'm
> not sure if a user form is the way to go or not. Could someone
> please
> point me in the right direction to get started? I would really
> appreciate it. Thanks.
>

 
Reply With Quote
 
Shane Devenshire
Guest
Posts: n/a
 
      13th Nov 2008
Hi,

I know you asked for the answers on a different sheet but first you should
look at this:

Put your cursor in the data and choose Data, Form. This gives you the
flexibiity you want without any need to program.

To take care of the issue of putting the answers on a different sheet, you
could put them, as another column in the data area, then you could format
them with a custom format of ;;; which hides the cell contents from
displaying in the cell. (There is also a way to hide the cell contents from
displaying on the formula bar.) Finally, you could set up formulas that
refer to the answer cells discussed above on another sheet.

If this helps, please click the Yes button.

Cheers,
Shane Devenshire

"Connie" wrote:

> I have a spreadsheet with the numbers 1-100 in column A. Column B
> contains exam questions in rows 1-100. I would like to create a user
> form that will display the questions one at a time to my students and
> allow them to enter an answer selection (A, B, C, or D). That answer
> will be stored on another tab for scoring. I would also like the
> studentgs to be able to navigate forward and backwards (in case they
> want to go back and change an answer to a previously answered
> question). I know this has to be simple, but I'm having trouble
> getting started. I've created other applications using Excel. I'm
> not sure if a user form is the way to go or not. Could someone
> please
> point me in the right direction to get started? I would really
> appreciate it. Thanks.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
change the display data format cell already contain data as date Harun Microsoft Excel Misc 2 1st Mar 2010 11:48 AM
find last cell in range with data, display cell address =?Utf-8?B?c2V2aTYx?= Microsoft Excel Worksheet Functions 14 29th Oct 2007 08:36 PM
Display contents of a cell in a user form text box -- Excel 2003 VBA hiskilini Microsoft Excel Misc 5 19th Feb 2007 03:05 PM
Using Button on User Form to save Data to specific Cell?? =?Utf-8?B?RGFyblRvb3Ru?= Microsoft Excel Programming 2 13th May 2006 03:20 PM
Data from user form to certain cell parteegolfer Microsoft Excel Programming 4 22nd Mar 2006 05:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:25 PM.