LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Text initially appears in a different cell to one selected until e

I have found what appears to be a glitch in an application I have made. It is
an educational program designed to generate new questions for the student to
practise each time a button is pressed.

I have included a drop-down menu, named as "Question_Type" so that the
student can set it to easy, medium or hard. I have attached some code to it
in the sheet module so that if a value is selected from the drop-down, it
will call the "New_Question" macro. This is contained in a separate module
and includes a last line to select the "Answer" cell:
(the second part of the worksheet_change code selects the "Answer" cell
again when the student enters a value there so that if it was incorrect, they
can have another go without needing to select that cell again)

(In worksheet code)
Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range

Set rng = Range("Question_Type")
If Not Intersect(rng, Target) Is Nothing Then
Call New_Question
End If

Set rng = Range("Answer")
If Not Intersect(rng, Target) Is Nothing Then
Range("Answer").Select
End If
End Sub


(In its own module)
Sub New_Question()
ActiveSheet.Calculate
Range("Plotted_Q").Value = Range("Random_Q").Value
Range("Answer").ClearContents

Range("Show_Hide_Answer") = False
Range("Answer").Select
End Sub


The glitch is that if you choose a difficulty level from the drop-down menu,
it all goes fine and finishes by selecting the "Answer" cell, but when you
start to type an answer, the text initially appears in the "Question_Type"
drop-down cell instead. Only when you press enter does it then go into the
"Answer" cell. Does anybody know how to correct this unusual behaviour?

Many thanks in anticipation, Neil Goldwasser
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting text problem - formula works initially Anne P Excel Worksheet Functions 3 July 8th 09 06:40 PM
Selected Cell in a Range Appears in another Cell Nick'o Excel Worksheet Functions 1 August 25th 07 08:26 AM
problem initially selecting a cell labrat64 Excel Discussion (Misc queries) 2 April 18th 07 08:54 PM
Plus sign no longer appears when cell is selected Ashley Excel Discussion (Misc queries) 2 December 14th 06 06:42 AM
An image appears when a cell is selected filo666 Excel Programming 0 December 9th 05 07:49 PM


All times are GMT +1. The time now is 12:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"