Create vocabulary learning tools in Excel
First, create a new Excel file and name it Timer (you can name it differently). You delete all the sheets, leaving only one sheet and naming Data. Our data block will have 2 columns: The first column is the title, the second column is the content. Note that data rows must be continuous.
Next, we create a module and name it ModuleTimer ( Figure 1 ) and enter the code 1. Here we use the API functions SetTimer and KillTimer.
Create a form named frmMain with the ShowModal property called False asshown in Figure 3and add the following objects:
- TextBox txtTopic with WordWrap attribute is True
- TextBox txtDescriptions with WordWrap attribute is True
- 4 command buttons with names: cmdStart, cmdStop, cmdSetTime, cmdClose, with Caption properties in turn: Start learning, Stop learning, Timing, Close ( see Figure 2 )
And now enter the code 2 for the frmMain form.
As a final step, go back to the Excel editing screen.
Show the Visual Basic toolbar (View-> Toolbars-> Control Toolbox), select Command Button (Figure 3) and place the Data Sheet (asshown in Figure 4), name it cmdHoc with the Caption attribute as Learn.Then double-click the command button to enter the following code:
Private Sub cmdHoc_Click ()
frmMain.Show
End Sub
Now go back to the Excel editing screen and turn off Design mode (click on the size icon and pen), and try clicking the command button to create it. A simple vocabulary learning tool, right?
Hopefully this article is useful for you.
CODE 1
Public Declare Function SetTimer Lib "user32" (ByVal HWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" (ByVal HWnd As Long, ByVal nIDEvent As Long) As Long
Public TimerID As Long
Public TimerSeconds As Single
Public BLDefaul As Boolean
Public StrTopic As String
Public StrDes As String
Public IntCount As Integer
Public BLHaveStartTimer As Boolean
Sub StartTimer ()
If BLDefaul = Then False
TimerSeconds = 3 'The default is 1 second
End If
TimerID = SetTimer (0 &, 0 &, TimerSeconds * 1000 &, AddressOf TimerProc)
End Sub
Sub SetTime ()
Dim VTime As Single
Dim VAns As String
BLDefaul = False
VAns = InputBox ("Please enter time (seconds) for timer", "Timing")
If Len (VAns) = 0 Then
BLDefaul = False
Else
VTime = CSng (VAns)
TimerSeconds = VTime
BLDefaul = True
End If
End Sub
Sub EndTimer ()
On Error Resume Next
KillTimer 0 &, TimerID
End Sub
Sub TimerProc (ByVal HWnd As Long, ByVal As Long, ByVal nIDEvent As Long, ByVal dwTimer As Long)
'
'Procedure is được xác định bởi Windows. Put your
'timer-related code here.
'
On Error GoTo Thongbao1
If IntCount = 0 Then IntCount = 2
MsgBox "Your data is not available!", VbOKOnly, "Vocabulary learning tool"
Sub Exit
End If
Else
IntCount = IntCount + 1
End If
frmMain.txtTopic.Text = StrTopic
frmMain.txtDescriptions.Text = StrDes
DoEvents
Sub Exit
Thongbao1:
Call EndTimer
End Sub
CODE 2
Private Sub cmdClose_Click ()
If BLHaveStartTimer = True Then
Call cmdStop_Click
End If
End
End Sub
'To make sure if you have called the Timer, you will not call
Private Sub cmdSetTime_Click ()
Call SetTime
Call cmdStop_Click
Call cmdStart_Click
End Sub
Private Sub cmdStart_Click ()
If BLHaveStartTimer = Then False
Call StartTimer
BLHaveStartTimer = True
End If
End Sub
Private Sub cmdStop_Click ()
Call EndTimer
BLHaveStartTimer = False
End Sub
Private Sub UserForm_
QueryClose (Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
MsgBox "Please close with the CLOSE button", vbOKOnly, "Vocabulary learning tool"
End If
End Sub
StrTopic = Application.Workbooks ("Timer").
Sheets ("Data"). Cells (IntCount, 1)
StrDes = Application.Workbooks ("Timer").
Sheets ("Data"). Cells (IntCount, 2)
If Len (Trim (StrTopic)) = 0 Then
IntCount = 2
StrTopic = Application.Workbooks ("Timer").
Sheets ("Data"). Cells (IntCount, 1)
StrDes = Application.
Workbooks ("Timer"). Sheets ("Data").
Cells (IntCount, 2)
If Len (Trim (StrTopic)) = 0 Then
BLHaveStartTimer = False
Call EndTimer
CHECK THE SOFT BACK
A reader who introduced "a former disc researcher" had some good advice on emergency boot floppy disks and rescue discs for Windows and other programs: "Don't believe them good ".Floppy disks for long periods of time can damage sectors.To confirm they are still working, you must check them every few months - by booting the PC from that floppy, or evaluating with the disk scanning tool: In Windows 98 and Me, select Start, Programs. Accessories.System Tools.ScanDisk.In Windows 2000 and XP, select Start, My Computer, right-click the floppy, select Properties, and click Tools, Check Now.
Le Van Duyet
You should read it
- How to do and research on Long Tail Keyword in SEO - Part 1
- How to take a long screenshot on a Windows 11 computer
- A simple way to delete a folder with a long name on Windows
- Strange spider species called 'Daddy loves long legs'
- 30+ the best long hair styles for girls
- Tips to overcome the milestones in Tan Thien Long Mobile
- How to recharge Tan Thien Long Mobile
- Dem Coc - The latest faction is causing a stir in Tan Thien Long Mobile
May be interested
- 8 convenient tools in Excel you may not know yetsimple features in excel will help you improve work efficiency with spreadsheets. here are 8 convenient tools in excel that you should use whenever you have the opportunity.
- MS Excel 2007 - Lesson 7: Create Macros in Excel 2007macros are advanced features, which can speed up editing or formatting that you can do regularly in an excel spreadsheet. in this excel lesson, tipsmake.com will show you how to use macros in excel 2007.
- 5 ways to learn 'unusual' foreign languages on a PC or smartphonelearning a proven new language can catch your stagnant brain to absorb new things. the less used parts in your brain need to 'exercise' and in turn give new ideas and solutions. of course, learning a language is hard work. but there are a number of applications and tools that can make this easier.
- Effective excel learning methodexcel, one of the most important and indispensable computer skills, and tipsmake share the most effective 'excel learning method'
- A complete guide to Excel 2016 (Part 14): Create complex formulasafter learning about the recipe in excel 2016, tipsmake.com continues to guide you how to create more complex formulas. invite you to consult!
- Compare Microsoft Excel and Power BIexcel and power bi are two very popular tools. both offer a range of visualization and analysis tools to help you create dashboards and reports.
- Test Microsoft Excel P16when using an application regularly, you will often get used to it and handle it faster. are you confident enough about your ability to use excel? try a little test to measure your excel proficiency!
- Create descriptive statistics table for dataset in Excelin excel supports user statistical analysis tools. here i introduce you how to create descriptive statistics tables for data sets in excel.
- How to Create a Gradebook on Microsoft Excellearning how to create a grade book sheet on microsoft excel is a great tool to use. it provides a spreadsheet of data and formulas that will minimize the time and effort spent on recording and calculating grades using old fashioned ways....
- Instructions to delete 0, hide 0 in Excelwhen working on excel, with statistics tables with 0, users can completely hide or hide the number 0 with the tools available on the system.