Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

New to VBA

  Asked By: Kenneth    Date: Sep 07    Category: MS Office    Views: 534
  

I am new to VBA and would like to know good
books and URLs/ online tutorials...can any one help me.

Share: 

 

6 Answers Found

 
Answer #1    Answered By: Richie Smith     Answered On: Sep 07

This page shows some useful Excel vba  :
http://www.mindspring.com/~tflynn/excelvba.html

 
Answer #2    Answered By: Emma Brown     Answered On: Sep 07

Check out Mark Thorpe's beginning Excel VBA lessons in TechTrax at this URL:

pubs.logicalexpressions.com/.../LPMFrame.asp
TH=33

The lessons build on each other, starting with no experience at all.

 
Answer #3    Answered By: Willie Gomez     Answered On: Sep 07

I am not sure whether my knowledge is too far below every body else
on this group, but i thought I would ask!

I'm a new teacher and using excel and VBA to create a mulitiple
choice quiz.

I have a seperate sheet for the questions (sheet2) and a user
interface on sheet1.

I have it working to go through the questions (question and 3
possible answers shown using labels). But what i am having problems
with is resetting the quiz once i get to the end of my quiz (end of
questions in sheet2 (1,35).

I would be really grateful if anyone could help. Sorry if I am not
making myself really clear!

 
Answer #4    Answered By: Pravat Jainukul     Answered On: Sep 07

You can ask anything of this group except for maybe money!!! ... and I
think even that's been done as well! :-)

.. And I don't believe that you're knowledge is so little if you've
gotten that far!

Could you maybe post the code please?

 
Answer #5    Answered By: Rocco Anderson     Answered On: Sep 07

if you look at the code, you will see i'm a
beginner, but I am enjoying trying to break the code now!! Althogh
could have thrown the laptop out of the windown many times before!!

Public question As Integer
Public score As Integer

Private Sub SpinToWin_Activate()

question = 2 'this sets this as the first question everytime you
load it
score = 0
Questions.Cells(1, 6) = question 'showing the question number on
spreadsheet 2


End Sub

Private Sub answer_a_lbl_Click()
'question 1 has been clicked as correct answer (the answer to
question one is in answer_a_label)
'location of correct answer is (1,5)also held in variable called
question

If Questions.Cells(question, 5) = 1 Then
score = score + 1
Questions.Cells(1, 7) = score
MsgBox "Well Done, you may continue with next question"


Dim Pausetime, Start, Finish, Angle As Integer
Dim Delaytime As Single

Start = Timer
Angle = Int(360 * Rnd)
Delaytime = 1.5

Do While Timer < Start + 5
SpinToWin.Shapes("spinner").Rotation = Angle
Angle = Angle + 10

delay (Delaytime)
Delaytime = Delaytime ^ 1.025
If Angle > 359 Then Angle = 0

Loop

Nxt_question

Else

MsgBox "D'oh! Try again!"
End If

End Sub
Private Sub answer_b_lbl_Click()
'question 1 has been clicked as correct answer (the answer to
question one is in answer_a_label)
'location of correct answer is (1,5)also held in variable called
question

If Questions.Cells(question, 5) = 2 Then
score = score + 1
Questions.Cells(1, 7) = score
MsgBox "Well Done, you may continue with next question"

Dim Pausetime, Start, Finish, Angle As Integer
Dim Delaytime As Single

Start = Timer
Angle = Int(360 * Rnd)
Delaytime = 1.5

Do While Timer < Start + 5
SpinToWin.Shapes("spinner").Rotation = Angle
Angle = Angle + 10

delay (Delaytime)
Delaytime = Delaytime ^ 1.025
If Angle > 359 Then Angle = 0

Loop

Nxt_question

Else

MsgBox "D'oh! Try again!"
End If

End Sub
Private Sub answer_c_lbl_Click()
'question 1 has been clicked as correct answer (the answer to
question one is in answer_a_label)
'location of correct answer is (1,5)also held in variable called
question

If Questions.Cells(question, 5) = 3 Then
score = score + 1
Questions.Cells(1, 7) = score
MsgBox "Well Done, you may continue with next question"

Dim Pausetime, Start, Finish, Angle As Integer
Dim Delaytime As Single

Start = Timer
Angle = Int(360 * Rnd)
Delaytime = 1.5

Do While Timer < Start + 5
SpinToWin.Shapes("spinner").Rotation = Angle
Angle = Angle + 10

delay (Delaytime)
Delaytime = Delaytime ^ 1.025
If Angle > 359 Then Angle = 0

Loop

Nxt_question

Else

MsgBox "D'oh! Try again!"
End If

End Sub
Private Sub q_start_Click()


Dim Pausetime, Start, Finish, Angle As Integer
Dim Delaytime As Single

Start = Timer
Angle = Int(360 * Rnd)
Delaytime = 1.5

Do While Timer < Start + 5
SpinToWin.Shapes("spinner").Rotation = Angle
Angle = Angle + 10

delay (Delaytime)
Delaytime = Delaytime ^ 1.025
If Angle > 359 Then Angle = 0

Loop

Nxt_question

End Sub

Private Sub Nxt_question()

question = question + 1
Questions.Cells(1, 6) = question
' adds one to the value which is used as the variable - question

SpinToWin.question_label = Questions.Cells(question, 1)
' displaying in label on SpinToWin the data from sheet1

SpinToWin.answer_a_lbl = Questions.Cells(question, 2)

SpinToWin.answer_b_lbl = Questions.Cells(question, 3) '
Displaying the answers

SpinToWin.answer_c_lbl = Questions.Cells(question, 4)

End Sub

Private Function delay(t As Integer)

For timedelay = 2 To t
DoEvents
Next timedelay

End Function

 
Answer #6    Answered By: Scott Simmons     Answered On: Sep 07

Is it possible to send me the spreadsheet off list please? You need a
counter added somewhere but I'm not sure where so I'd like to step
through the code with the VBE.

 
Didn't find what you were looking for? Find more on New to VBA Or get search suggestion and latest updates.




Tagged: