flash cards


Posted by raphael on February 03, 2002 4:19 PM

Let's say I had a list of vocabulary words to study.
Can I use Excel/Visual Basic to create a set of flash cards?



Posted by Jacob on February 03, 2002 5:14 PM

Hi

You could use a message box or userform to do this.

The userform would propbably be better since it would have more options.

Lets say you have the vocabluary words or whatever in A1:A100 on Sheet1


Make a userform with a label (label1)

Put this code in the userform code

Dim MyValue as String
Dim LastRow as Integer

Sub Userform_Initialize()

MyValue = 1
LastRow = sheets("Sheet1").range("A65536").end(xlup).row

label1.caption = sheets("Sheet1").range("A" & MyValue).value

End Sub

Sub NextButton_Click

If MyValue = LastRow Then
MyValue = 1
Else
MyValue = MyValue + 1
End If

label1.caption = sheets("Sheet1").range("A" & MyValue).value

End Sub

Sub PrevButton_Click

If MyValue = 1 Then
MyValue = LastRow
Else
MyValue = MyValue - 1
End If

label1.caption = sheets("Sheet1").range("A" & MyValue).value

End Sub


On The userform make two buttons, one named nextbutton and one name prevbutton

This should get you started.

HTH

Jacob