• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Prepare Question bank

Hi, vrunda!


I downloaded your file, opened it, got displayed the light cyan user form, clicked on Start Exam button and had enabled the Questions worksheet, with the violet clock at L5:L6 running back from 00:00:59 thru 00:00:01 and nothing moved during the almost whole minute.


Could you test it on another computer to discard video adapter card issues?


Regards!
 
Please observe the cursor too. Secondly why the user form is not unloading & "questions" sheet is activated
 
Tried on other computer too, It is moving after 3-4 seconds.

One more thing can we set scrolling if sheet upto 200 questions..in properties of sheet.
 
Hi, vrunda!


Running it again and paying more attention (almost fixing my sight in the mouse cursor) I noticed a very slightly (because of short) cursor blinking, but that's due to the updating process of L5 cell each second.


If you run it on a computer with a display with high refresh rate (75 Mhz or more, better if 120 Mhz or 200/240 for newest ones) it's close to imperceptible and it lets you work with the required concentration in the job. For lower refresh rates (i.e., older displays) or slow video cards (I'm running on a PC with a powerful GPU card) it might last more ms (miliseconds, my monitor updates at 2ms) making it more noticeable.


Regarding the stop at 1s instead of zero I updated your TickTock Sub code as follows:

-----

[pre]
Code:
Sub TickTock()
With ThisWorkbook.Sheets("Questions").Range("L5")
.Value = .Value - (1 / 86400)
If .Value < 0 Then .Value = 0
If Second(.Value) = 0 Then
Call StopClock
Exit Sub
End If
End With
NextTick = Now + TimeValue("00:00:01")
Application.OnTime NextTick, "TickTock"
End Sub
[/pre]
-----


Just advise if any issue.


Regards!
 
I also want to ask in code if i use sheet name, then code will not work if someone changes sheet name. so how to solve this issue?
 
Hi, vrunda!


I didn't read your two last comments while I sent mine. Regarding cursor blinking, definitively it's a hardware problem.


What do you mean with "setting scrolling if sheet up to 200 questions... in properties of sheet"? Please elaborate.


About seeing the user form, it doesn't happen if you if it gets shown at open time by the code of the open workbook event. If you load it manually from the VBA editor when clicking the button Start it gets unloaded too, maybe what you see is the form at the VBA editor in design mode concurrently with the Excel worksheet? Otherwise I don't know what to say as I can reproduce your issue.


Regards!


EDIT: Please elaborate a bit more, I didn't understand your last question regarding sheet name in the code.
 
1). If someone change name of worksheet("Questions") to ("sheet1") then the code of start button does not work. Can we use something else in code to refer to sheet like wksques etc. But sheet tab name should be Questions only.?


2). Regarding scrolling of sheet means: as i want to display only 200 questions so can i lock the scrolling of sheet to 200 rows Then the 201 & onwards questions will not be displayed. I read somewhere about locking the scrolling of worksheet.


3). About 120mhz & new computer , what should I do to stop the blinking of worksheet.?

Thanks!!
 
Hi, vrunda!


1) The label on the tab is the worksheet name. About changing the name from "Questions" to "XXXX" why would you do that? But if you want, you may store the value of the worksheet on a cell somewhere and then use that cell contents whenever you use the constant string "Questions".

You can use a "Dim gsWSQuestion as string" to define where store the value of the worksheet name and a "gsWSQuestion = Worksheets("where you say").Range("where you want").Value" to retrieve it.


2) If I don't remember wrongly in my uploaded version with the final suggested version you didn't see more questions than those set in the Parameters worksheet. Despite of this you can hide the not wanted rows to be displayed with a piece of code like this:

-----

[pre]
Code:
Rows("207:207").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Hidden = True
[/pre]
-----


3) Nothing could be done, it's an interaction between the display, the video adapter and the memory where you have nothing to do but bear it, eliminate it or place the cursor far from the entry cells and use cursor movement instead.


Regards!
 
Your worksheet was very good enough, but the code in it was very difficult for me to understand. I m learning VBA. Thats why I thought to go for one which i can self prepare & learn while making it.

1) About Worksheet name : - Even if we lock the workbook, worksheets , the worksheets can be renamed.. so just wanted to make it full proof.


2) I got the above code... it will work for me.


3) If the computer has more memory then it would not blink?
 
Hi, vrunda!

If you protect the workbook structure you can't rename worksheets (neither add nor delete). Additional RAM will help if it's shared for video or fully occupied by other programs running. Increasing the refresh rate to the maximum allowed for the display will help too.

Yes timer can be displayed in user forms, just create one, add a label and place some code like this where you placed the L5 update. Code samples:

-----

[pre]
Code:
Sub x()
UserForm1.Show vbModeless
End Sub

Sub y()
UserForm1.Label1.Caption = Now()
End Sub

Sub z()
Unload UserForm1
End Sub
[/pre]
-----

Regards!
 
Back
Top