Microsoft Office Excel ® Kod Kılavuzu

Microsoft Office Excel® Code Guide

10 Temmuz 2007 Salı

Multiple MatchEntry



'UserForm1

'A) VBProject References List

'Visual Basic For Application
'Microsoft Excel 11.0 Object Library
'OLE Automation
'Microsoft Office 11.0 Object Library
'Microsoft Forms 2.0 Object Library
'Microsoft Windows Common Control 6.0 (SP6)
'B) Addition Tools on UserForm1
'Frame1
'Frame1\Image1, Label1, Label2
'ComboBox1, Listbox1, TreeView1
Option Explicit
Dim i As Long
Dim Metin As String
Private Sub UserForm_Initialize()

On Error Resume Next
Me.Caption = "[PBİD®] Multiple MatchEntry"
Call EkranDüzenle
Call ListeKur
End Sub
Private Sub ComboBox1_Change()

On Error Resume Next
ListBox1.ListIndex = ComboBox1.ListIndex
With TreeView1
.SelectedItem.BackColor = vbWhite
.Nodes("Key" & ComboBox1.Value).EnsureVisible
.Nodes("Key" & ComboBox1.Value).Selected = True
.SelectedItem.BackColor = vbGreen
End With
ComboBox1.SetFocus
End Sub
Private Sub ComboBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)

On Error Resume Next
If KeyAscii = VBA.vbKeyReturn Then
           VBA.SendKeys "{tab}"
          KeyAscii = 0
          Exit Sub
End If
With Me.ActiveControl
If KeyAscii = VBA.vbKeyBack And .SelStart > 0 Then
Metin = VBA.Left$(.Text, .SelStart - 1)
Else
Metin = VBA.Left$(.Text, .SelStart) & VBA.Chr(KeyAscii)
End If
KeyAscii = 0
For i = 0 To .ListCount - 1
If VBA.UCase$(Metin) = VBA.UCase$(VBA.Left$(.List(i), VBA.Len(Metin))) Then
.ListIndex = i
.Text = .List(i)
.SelStart = VBA.Len(Metin)
.SelLength = VBA.Len(.List(i)) - (VBA.Len(Metin))
Exit For
End If
Next
End With
End Sub
Private Sub ListBox1_Click()

On Error Resume Next
ComboBox1.ListIndex = ListBox1.ListIndex
End Sub
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)

On Error Resume Next
With TreeView1
.SelectedItem.BackColor = vbWhite
.Nodes("Key" & ComboBox1.Value).EnsureVisible
.Nodes("Key" & ComboBox1.Value).Selected = True
.SelectedItem.BackColor = vbGreen
ListBox1.Value = .SelectedItem.Text
ComboBox1.Value = .SelectedItem.Text
End With
End Sub
Private Sub ListeKur()
'Load the lists

On Error Resume Next
With ComboBox1
.AddItem "ABD Virgin Adaları"
.AddItem "Afganistan"
.AddItem "Almanya"
.AddItem "Amerika Birleşik Devletleri"
.AddItem "Amerikan Samoası"
.AddItem "Andora"
.AddItem "Angola"
.AddItem "Anguilla"
.AddItem "Antartika"
.AddItem "Antigua ve Barbuda"
.AddItem "Arjantin"
.AddItem "Arnavutluk"
.AddItem "Aruba"
.AddItem "Avustralya"
.AddItem "Avusturya"
.AddItem "Azerbaycan"
.AddItem "Bahamalar"
.AddItem "Bahreyn"
.AddItem "Bangladeş"
.AddItem "Barbados"
.AddItem "Batı Sahra"
.AddItem "Belarus"
.AddItem "Belçika"
.AddItem "Belize"
.AddItem "Benin"
.AddItem "Bermuda"
.AddItem "Birleşik Arap Emirlikleri"
.AddItem "Birleşik Krallık"
.AddItem "Bolivya"
.AddItem "Bosna Hersek"
.AddItem "Botsvana"
.AddItem "Bouvet Adası"
.AddItem "Brezilya"
.AddItem "Brunei"
.AddItem "Bulgaristan"
.AddItem "Burkina Faso"
.AddItem "Burundi"
.AddItem "Butan"
.AddItem "Cayman Adaları"
.AddItem "Cebelitarık"
.AddItem "Cezayir"
.AddItem "Christmas Adası"
.AddItem "Cibuti"
.AddItem "Cocos (Kelling) Adaları"
.AddItem "Cook Adaları"
.AddItem "Çad"
.AddItem "Çek Cumhuriyeti"
.AddItem "Çin"
.AddItem "Danimarka"
.AddItem "Demokratik Kongo Cumhuriyeti"
.AddItem "Doğu Timor"
.AddItem "Dominik Cumhuriyeti"
.AddItem "Dominik"
.AddItem "Ekvador"
.AddItem "Ekvator Ginesi"
.AddItem "El Salvador"
.AddItem "Endonezya"
.AddItem "Eritre"
.AddItem "Ermenistan"
.AddItem "Estonya"
.AddItem "Etiyopya"
.AddItem "Falkland Adaları"
.AddItem "Faroe Adaları"
.AddItem "Fas"
.AddItem "Fiji"
.AddItem "Fildişi Sahilleri"
.AddItem "Filipinler"
.AddItem "Finlandiya"
.AddItem "Fransa"
.AddItem "Fransız Guyanası"
.AddItem "Fransız Güney Eyaletleri"
.AddItem "Fransız Polinezyası"
.AddItem "Gabon"
.AddItem "Gambiya"
.AddItem "Gana"
.AddItem "Gine"
.AddItem "Gine Bissau"
.AddItem "Grenada"
.AddItem "Grönland"
.AddItem "Guadeloupe"
.AddItem "Guatemala"
.AddItem "Guyana"
.AddItem "Güney Afrika"
.AddItem "Güney Georgia ve Güney Sandwich Adaları"
.AddItem "Güney Kıbrıs Rum Kesimi"
.AddItem "Güney Kore"
.AddItem "Gürcistan"
.AddItem "Haiti"
.AddItem "Heard ve McDonald Adaları"
.AddItem "Hindistan"
.AddItem "Hırvatistan"
.AddItem "Hollanda Antilleri"
.AddItem "Hollanda"
.AddItem "Honduras"
.AddItem "Hong Kong"
.AddItem "Irak"
.AddItem "İngiliz Hint Okyanusu Bölgesi"
.AddItem "İngiliz Virgin Adaları"
.AddItem "İran"
.AddItem "İrlanda"
.AddItem "İspanya"
.AddItem "İsrail"
.AddItem "İsveç"
.AddItem "İsviçre"
.AddItem "İtalya"
.AddItem "İzlanda"
.AddItem "Jamaika"
.AddItem "Japonya"
.AddItem "Kamboçya"
.AddItem "Kamerun"
.AddItem "Kanada"
.AddItem "Katar"
.AddItem "Kazakistan"
.AddItem "Kenya"
.AddItem "Kırgızistan"
.AddItem "Kiribati"
.AddItem "Kolombiya"
.AddItem "Komor"
.AddItem "Kongo"
.AddItem "Kosta Rika"
.AddItem "Kuveyt"
.AddItem "Kuzey Kore"
.AddItem "Kuzey Mariana Adaları"
.AddItem "Küba"
.AddItem "Laos"
.AddItem "Lesoto"
.AddItem "Letonya"
.AddItem "Liberya"
.AddItem "Libya"
.AddItem "Lihtenştayn"
.AddItem "Litvanya"
.AddItem "Lübnan"
.AddItem "Lüksemburg"
.AddItem "Macaristan"
.AddItem "Madagaskar"
.AddItem "Makao"
.AddItem "Makedonya Cumhuriyeti"
.AddItem "Malavi"
.AddItem "Maldivler"
.AddItem "Malezya"
.AddItem "Mali"
.AddItem "Malta"
.AddItem "Marshall Adaları"
.AddItem "Martinique"
.AddItem "Mayotte"
.AddItem "Meksika"
.AddItem "Mikronezya"
.AddItem "Mısır"
.AddItem "Moğolistan"
.AddItem "Moldova"
.AddItem "Monako"
.AddItem "Montserrat"
.AddItem "Moritanya"
.AddItem "Morityus"
.AddItem "Mozambik"
.AddItem "Myanmar"
.AddItem "Namibya"
.AddItem "Nauru"
.AddItem "Nepal"
.AddItem "Nijer"
.AddItem "Nijerya"
.AddItem "Nikaragua"
.AddItem "Niue"
.AddItem "Norfolk Adası"
.AddItem "Norveç"
.AddItem "Orta Afrika Cumhuriyeti"
.AddItem "Özbekistan"
.AddItem "Pakistan"
.AddItem "Palau"
.AddItem "Panama"
.AddItem "Papua Yeni Gine"
.AddItem "Paraguay"
.AddItem "Peru"
.AddItem "Pitcairn Adası"
.AddItem "Polonya"
.AddItem "Portekiz"
.AddItem "Porto Riko"
.AddItem "Reunion"
.AddItem "Romanya"
.AddItem "Ruanda"
.AddItem "Rusya"
.AddItem "Saint Helena"
.AddItem "Saint Kitts ve Nevis"
.AddItem "Saint Lucia"
.AddItem "Saint Pierre ve Miquelon"
.AddItem "Saint Vincent ve Grenadinler"
.AddItem "Samoa"
.AddItem "San Marino"
.AddItem "Sao Tome ve Principe"
.AddItem "Senegal"
.AddItem "Seyşel Adaları (Seyşeller)"
.AddItem "Sierra Leone"
.AddItem "Singapur"
.AddItem "Slovakya"
.AddItem "Slovenya"
.AddItem "Solomon Adaları"
.AddItem "Somali"
.AddItem "Sri Lanka"
.AddItem "Sudan"
.AddItem "Surinam"
.AddItem "Suriye"
.AddItem "Suudi Arabistan"
.AddItem "Svalbard ve Jan Mayen"
.AddItem "Svaziland"
.AddItem "Şili"
.AddItem "Tacikistan"
.AddItem "Tanzanya"
.AddItem "Tayland"
.AddItem "Tayvan"
.AddItem "Togo"
.AddItem "Tokelau"
.AddItem "Tonga"
.AddItem "Trinidad ve Tobago"
.AddItem "Tunus"
.AddItem "Tuvalu"
.AddItem "Türk ve Caicos Adaları"
.AddItem "Türkiye"
.AddItem "Türkmenistan"
.AddItem "Uganda"
.AddItem "Ukrayna"
.AddItem "Umman"
.AddItem "Uruguay"
.AddItem "Ürdün"
.AddItem "Vallis ve Futuna Adaları"
.AddItem "Vanuatu"
.AddItem "Vatikan"
.AddItem "Venezuela"
.AddItem "Vietnam"
.AddItem "Yemen"
.AddItem "Yeni Kaledonya"
.AddItem "Yeni Zelanda"
.AddItem "Yeşil Burun"
.AddItem "Yugoslavya"
.AddItem "Yunanistan"
.AddItem "Zambiya"
.AddItem "Zimbabve"
End With
For i = 0 To (ComboBox1.ListCount - 1)
ListBox1.AddItem ComboBox1.List(i, 0)
Next i
With TreeView1
.Nodes.Add , , "KeyA", "A"
.Nodes.Add , , "KeyB", "B"
.Nodes.Add , , "KeyC", "C"
.Nodes.Add , , "KeyÇ", "Ç"
.Nodes.Add , , "KeyD", "D"
.Nodes.Add , , "KeyE", "E"
.Nodes.Add , , "KeyF", "F"
.Nodes.Add , , "KeyG", "G"
.Nodes.Add , , "KeyĞ", "Ğ"
.Nodes.Add , , "KeyH", "H"
.Nodes.Add , , "KeyI", "I"
.Nodes.Add , , "Keyİ", "İ"
.Nodes.Add , , "KeyJ", "J"
.Nodes.Add , , "KeyK", "K"
.Nodes.Add , , "KeyL", "L"
.Nodes.Add , , "KeyM", "M"
.Nodes.Add , , "KeyN", "N"
.Nodes.Add , , "KeyO", "O"
.Nodes.Add , , "KeyÖ", "Ö"
.Nodes.Add , , "KeyP", "P"
.Nodes.Add , , "KeyQ", "Q"
.Nodes.Add , , "KeyR", "R"
.Nodes.Add , , "KeyS", "S"
.Nodes.Add , , "KeyŞ", "Ş"
.Nodes.Add , , "KeyT", "T"
.Nodes.Add , , "KeyU", "U"
.Nodes.Add , , "KeyÜ", "Ü"
.Nodes.Add , , "KeyV", "V"
.Nodes.Add , , "KeyW", "W"
.Nodes.Add , , "KeyX", "X"
.Nodes.Add , , "KeyY", "Y"
.Nodes.Add , , "KeyZ", "Z"
For i = 1 To ListBox1.ListCount
.Nodes.Add "Key" & VBA.Left(VBA.UCase(VBA.UCase(ListBox1.List((i - 1), 0))), 1), 4, "Key" & ListBox1.List((i - 1), 0), ListBox1.List((i - 1), 0)
.Nodes("Key" & ListBox1.List((i - 1), 0)).ForeColor = vbBlue
Next i
End With
End Sub
Private Sub EkranDüzenle()

On Error Resume Next
With Me
.Height = 282.75
.Width = 432.75
.BackColor = vbWhite
With Frame1
.Caption = ""
.Left = -1
.Top = -1
.Height = 30
.Width = Me.Width + 12
.Picture = LoadPicture("D:\Mustafa ULUSARAÇ\Blogspot\ZarifVİSTA.bmp")
.PictureAlignment = fmPictureAlignmentCenter
.PictureSizeMode = fmPictureSizeModeStretch
.SpecialEffect = fmSpecialEffectFlat
With Image1
.Left = 1.5
.Top = 1.5
.Height = 24
.Width = 24
.BorderColor = vbBlue
.BackStyle = fmBackStyleTransparent
.Picture = LoadPicture("D:\Mustafa ULUSARAÇ\Blogspot\Örnekİkonlar\PBİD.ico")
.PictureAlignment = fmPictureAlignmentCenter
.PictureSizeMode = fmPictureSizeModeClip
End With
With Label1
.Left = 1.5 + 24 + 3
.Top = 1.5
.Caption = "Mustafa ULUSARAÇ"
.BackStyle = fmBackStyleTransparent
.SpecialEffect = fmSpecialEffectFlat
.BorderStyle = fmBorderStyleNone
.Height = 12
.Width = 180
.Font.Bold = True
.ForeColor = vbBlue
End With
With Label2
.Left = 1.5 + 24 + 3
.Top = 13.5
.Caption = "01ulusarac@superonline.com"
.BackStyle = fmBackStyleTransparent
.SpecialEffect = fmSpecialEffectFlat
.BorderStyle = fmBorderStyleNone
.Height = 12
.Width = 180
.Font.Bold = True
.ForeColor = vbBlue
End With
End With
With ComboBox1
.Left = 6
.Top = 36
.Height = 18
.Width = 192
.SpecialEffect = fmSpecialEffectFlat
.BackColor = vbWhite
.ListStyle = fmListStylePlain
.DragBehavior = fmDragBehaviorDisabled
.DropButtonStyle = fmDropButtonStyleArrow
.Enabled = True
.AutoSize = False
.AutoTab = True
.BackStyle = fmBackStyleOpaque
.BorderStyle = fmBorderStyleNone
.EnterFieldBehavior = fmEnterFieldBehaviorSelectAll
.IMEMode = fmIMEModeNoControl
.MatchEntry = fmMatchEntryComplete
.MatchRequired = False
.MaxLength = 0
.SelectionMargin = True
.ShowDropButtonWhen = fmShowDropButtonWhenAlways
.Style = fmStyleDropDownCombo
End With
With ListBox1
.Top = 54
.Left = 6
.Height = 198.05
.Width = 192
.ColumnCount = 1
.SpecialEffect = fmSpecialEffectFlat
.BackColor = vbWhite
End With
With TreeView1
.Appearance = ccFlat
.BorderStyle = ccNone
.CheckBoxes = False
.FullRowSelect = False
.Height = 216
.Indentation = 14
.LineStyle = tvwRootLines
.Scroll = True
.Sorted = False
.Style = tvwTreelinesPlusMinusPictureText
.Top = 36
.Width = 222 : .Left = 198
End With
End With
End Sub

Hiç yorum yok:

Blog Arşivi

Bu gadget'ta bir hata oluştu

Bu Blogda Ara

Contributor

Contributor
Mustafa ULUSARAÇ İstanbul, TÜRKİYE
free counters
T. C. Central Bank Indicative Exchange Rates
Currency Exchange Rate Widget,Currency Converter Widget
Borsa İstanbul