ปรุงก่อนชิม
Location :
นนทบุรี Thailand

[Profile ทั้งหมด]

ฝากข้อความหลังไมค์
Rss Feed
Smember
ผู้ติดตามบล็อก : 4 คน [?]




New Comments
Group Blog
 
All Blogs
 
Friends' blogs
[Add ปรุงก่อนชิม's blog to your web]
Links
 

 
โปรแกรมสอนลูกอ่าน ภาษาอังกฤษ

ใช้ VBA ของ EXCEL

ใส่ข้อมูล พยัญชนะ และ สระ ระหว่างภาษาอังกฤษและภาษาไทย ไว้ที่ Sheet2
สร้าง form userform1 ตามรูป

 copy code ไว้ที่ Module1 ดังนี้
Option Explicit
Global Eword As String
Global Initial(1, 100) As String
Global Vowel(1, 100) As String
Global Final(1, 100) As String
Global Vocab(1, 2000) As String
Global Initial_end, Vowel_end, Final_end, Vocab_end As Integer
Private Sub readEnglish()
Dim k  As Integer
Initial_end = DataEnd(2)
Vowel_end = DataEnd(5)
Final_end = DataEnd(8)
Vocab_end = DataEnd(11)
            For k = 4 To Vocab_end
                    UserForm1.ComboBox1.AddItem Cells(k, 11).Value
            Next k
UserForm1.Show
End Sub
Sub Main()
Dim i, itemSelect  As Integer
Eword = Excel.WorksheetFunction.Proper(UserForm1.ComboBox1.Value)
'--------------- Get value
        For i = 3 To Initial_end 'Initial
                Initial(0, i) = Sheets(2).Cells(i, 1).Value  'eng
                Initial(1, i) = Sheets(2).Cells(i, 2).Value  'thai
        Next i
        For i = 3 To Vowel_end  'vowel
                Vowel(0, i) = Sheets(2).Cells(i, 4).Value 'eng
                Vowel(1, i) = Sheets(2).Cells(i, 5).Value  'thai
        Next i
        For i = 3 To Final_end  'final
                Final(0, i) = Sheets(2).Cells(i, 7).Value 'eng
                Final(1, i) = Sheets(2).Cells(i, 8).Value 'thai
        Next i
        For i = 3 To Vocab_end  'final
                Vocab(0, i) = Sheets(2).Cells(i, 11).Value
                Vocab(1, i) = Sheets(2).Cells(i, 12).Value
        Next i
        '---------------search in Eword
For i = 3 To Vocab_end
            If Eword = Vocab(0, i) Then
                        UserForm1.Label8.Caption = Vocab(1, i)
                        Exit For
            End If
Next i

For i = 3 To 27
                If InStr(1, Eword, Vowel(0, i)) Then
                        If Len(Vowel(0, i)) = 1 Then
                                    ElseIf Len(Vowel(0, i)) = 2 Then
                                    Else
                        End If
                        UserForm1.Label1.Caption = Left(Eword, Findposition(Eword, Vowel(0, i)))
                        UserForm1.Label2.Caption = Vowel(0, i)
                        UserForm1.Label3.Caption = Right(Eword, Len(Eword) - Len(Vowel(0, i)) - Findposition(Eword, Vowel(0, i)))
                        Exit For
                End If
Next i
'------- Thai
For i = 3 To Initial_end
        If UserForm1.Label1.Caption = Excel.WorksheetFunction.Proper(Initial(0, i)) Then
                UserForm1.Label4.Caption = Initial(1, i)
                Exit For
        Else
                UserForm1.Label4.Caption = ".."
        End If
Next i

For i = 3 To Vowel_end
        If UserForm1.Label2.Caption = Vowel(0, i) Then
                UserForm1.Label5.Caption = Vowel(1, i)
                Exit For
        Else
                UserForm1.Label5.Caption = ".."
        End If
Next i

For i = 3 To Final_end
        If UserForm1.Label3.Caption = Final(0, i) Then
                UserForm1.Label6.Caption = Final(1, i)
                Exit For
        Else
                UserForm1.Label6.Caption = ".."
        End If
Next i




Sheets(1).Select
End Sub
Function DataEnd(columnData As Integer) As Integer
Dim i As Integer
        i = 3
        Sheets(2).Select
        Cells(4, columnData).Select
        Do
                Selection.Offset(1, 0).Select
                i = i + 1
        Loop Until ActiveCell.Value = ""
        DataEnd = i
End Function
Sub test()
MsgBox Findposition("Threech", "ee")
End Sub
        Function Findposition(Eword As String, ch As String) As Integer
        Dim i As Integer
        For i = 1 To Len(Eword)
        If Mid(Eword, i, 1) = Left(ch, 1) Then
        Findposition = i - 1
        Exit For
        End If
        Next i
        End Function
'
'
'
'
'
'
'

'code ของ userform1 ดังนี้
'
'
'

Option Explicit

Private Sub ComboBox1_Change()
Dim i, j As Integer
'----clear memory
Label1.Caption = ""
Label2.Caption = ""
Label3.Caption = ""
Label4.Caption = ""
Label5.Caption = ""
Label6.Caption = ""
Label8.Caption = ""
For i = LBound(Initial) To UBound(Initial)
        For j = 0 To 1
                Initial(j, i) = ""
        Next j
Next i
'----clear memory
For i = LBound(Vowel) To UBound(Vowel)
        For j = 0 To 1
                Initial(j, i) = ""
        Next j
Next i
'----clear memory
For i = LBound(Final) To UBound(Final)
        For j = 0 To 1
                Initial(j, i) = ""
        Next j
Next i
'----clear memory
For i = LBound(Vocab) To UBound(Vocab)
        For j = 0 To 1
                Initial(j, i) = ""
        Next j
Next i
End Sub

Private Sub ComboBox1_Click()
Dim i, j As Integer
'----clear memory
For i = LBound(Initial) To UBound(Initial)
        For j = 0 To 1
                Initial(j, i) = ""
        Next j
Next i
'----clear memory
For i = LBound(Vowel) To UBound(Vowel)
        For j = 0 To 1
                Initial(j, i) = ""
        Next j
Next i
'----clear memory
For i = LBound(Final) To UBound(Final)
        For j = 0 To 1
                Initial(j, i) = ""
        Next j
Next i
'----clear memory
For i = LBound(Vocab) To UBound(Vocab)
        For j = 0 To 1
                Initial(j, i) = ""
        Next j
Next i
End Sub

Private Sub CommandButton1_Click()
Call Module1.Main
End Sub


ใส่ file ข้อมูลที่ sheet2 ตามรูป






Create Date : 05 กุมภาพันธ์ 2556
Last Update : 6 กุมภาพันธ์ 2556 8:13:08 น. 3 comments
Counter : 1610 Pageviews.

 
ขอบคูณครับ


โดย: เหน่ง IP: 171.6.175.194 วันที่: 18 กุมภาพันธ์ 2556 เวลา:7:52:07 น.  

 
ได้แต่ชื่นชม shell shockers ไม่รู้วิธีสอนลูกให้เก่งภาษาอังกฤษของเขายังไง! ... เพราะ Monkey Stories เป็นชุดครบ 4 ทักษะที่ช่วยให้เด็กฟัง - พูด - อ่าน- เขียนได้คล่อ


โดย: laura (สมาชิกหมายเลข 7217835 ) วันที่: 30 ธันวาคม 2565 เวลา:16:37:32 น.  

 
เริ่มต้นด้วยการอ่านเรื่องสั้น drive mad ๆ ที่มีคำศัพท์ไม่เกิน 100 คำ แล้วให้ลูกอ่านเรื่องนั้นออกเสียงตามด้วยการตอบคำถามเกี่ยวกับเนื้อเรื่อง


โดย: สมาชิกหมายเลข 7217835 วันที่: 3 มีนาคม 2566 เวลา:8:46:14 น.  

ชื่อ :
Comment :
  *ใช้ code html ตกแต่งข้อความได้เฉพาะสมาชิก
 
 Pantip.com | PantipMarket.com | Pantown.com | © 2004 BlogGang.com allrights reserved.