Makro Kod Listesi
Excel de kullanılan Makro Kodlarının Listesi


text dosyasından veri alma a sütununa yazma

ID : 2101
ISLEM : text dosyasından veri alma a sütununa yazma
MAKRO KODU : Sub OuvreTXT() Workbooks.OpenText Filename:="C:\ajeter\TEST.TXT", _ Origin:=xlWindows, StartRow:=1, _ DataType:=xlDelimited, _ TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=False, Tab:=False, _ Semicolon:=True, Comma:=False, Space:=False, _ Other:=False, FieldInfo:=Array(Array(1, 1), _ Array(2, 1), Array(3, 1)) End Sub

text dosyasını açar yeni kitaba açar

ID : 2102
ISLEM : text dosyasını açar yeni kitaba açar
MAKRO KODU : Sub Dateiimport() Quelle = Application.GetOpenFilename("TXT-Dateien , *.TXT") Workbooks.OpenText Filename:=Quelle, Origin:=xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _ xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon _ :=False, Comma:=False, Space:=False, Other:=False, FieldInfo _ :=Array(1, 1) End Sub

textboka veri kopyalama

ID : 2103
ISLEM : textboka veri kopyalama
MAKRO KODU : TEK BOK 1'İ KESER (BAŞKA YERE YAPIŞTIRMAK İÇİN) Private Sub CommandButton2_Click() TextBox1.Cut End Sub 'TEK BOKA VERİ YAPIŞTIRIR Private Sub CommandButton7_Click() TextBox11.Paste End Sub

textbok'tan hücrelere veri girme

ID : 2104
ISLEM : textbok'tan hücrelere veri girme
MAKRO KODU : BU KODU TextBox1 E YAZARSANIZ TEXTBOXA GİRDİĞİNİZ VERİLERİ A1 HÜCRESİNE YAZAR Private Sub TextBox1_Change() [a1] = TextBox1.Text End Sub

textbox 10 dan küçük ise uyarı verir

ID : 2105
ISLEM : textbox 10 dan küçük ise uyarı verir
MAKRO KODU : Textbox çıkışına veya commandbutona bağlayabilirsiniz Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) If Val(TextBox1.Text) <= 10 Then MsgBox "Sayı 10'den büyük olmalı", vbInformation TextBox1.SetFocus Exit Sub End If End Sub

textbox büyük harf türkçe karakter sorunu

ID : 2106
ISLEM : textbox büyük harf türkçe karakter sorunu
MAKRO KODU : Private Sub TextBox1_Change() On Error Resume Next [aa1] = "=büyükharf(""" & TextBox1 & """)" [aa1] = "=upper(""" & TextBox1 & """)" TextBox1 = [aa1] End Sub Veya; Private Sub TextBox1_Change() On Error Resume Next TextBox1 = Evaluate("=büyükharf(""" & TextBox1 & """)") TextBox1 = Evaluate("=upper(""" & TextBox1 & """)") End Sub

textbox da alt+enter ve rakam formati / boş hucreyi bul

ID : 2107
ISLEM : textbox da alt+enter ve rakam formati / boş hucreyi bul
MAKRO KODU : Private Sub CommandButton1_Click() For a = 1 To 40 b = Sheets("sayfa1").Cells(a, 1).Value If b = "" Then Sheets("sayfa1").Cells(a, 1) = TextBox1.Value Sheets("sayfa1").Cells(a, 2) = ComboBox1.Text GoTo 10 End If Next a Sheets("sayfa1").Cells(1, 3) = "TÜM SATIRLAR DOLU" 'UYARI MESAJI 10 End Sub

textbox format

ID : 2108
ISLEM : textbox format
MAKRO KODU : Aşağıdaki şekilde yazın sorununuz çözülecektir. TextBox17=Format(TextBox17,"#,##0.00")

textbox her seçildiğinde içeriği silinsin

ID : 2109
ISLEM : textbox her seçildiğinde içeriği silinsin
MAKRO KODU : Private Sub TextBox1_GotFocus() TextBox1.Text = "" End Sub

textbox her seçildiğinde içeriğinin silinmesi

ID : 2110
ISLEM : textbox her seçildiğinde içeriğinin silinmesi
MAKRO KODU : Private Sub TextBox1_GotFocus() TextBox1.Text = "" End Sub

textbox hücre toplaminin yazdirilmasi

ID : 2111
ISLEM : textbox hücre toplaminin yazdirilmasi
MAKRO KODU : UserForm Üzerinde; TextBox1,TextBox2 ve TextBox3 olduğunu varsayalım. TextBox1 A1 Hücresine ilişik TextBox2 A2 Hücresine ilişik TextBox3 A3 Hücresine ilişik TextBox3'de Toplam Sonucu Görmek isterseniz. Textbox1 ve 2'deki değerleri TextBox3'de görmek için. Kod: Private Sub TextBox1_Change() TextBox3.Value = Val(TextBox1.Value) + Val(TextBox2.Value) End Sub Private Sub TextBox2_Change() TextBox3.Value = Val(TextBox1.Value) + Val(TextBox2.Value) End Sub Hücredeki değeri Sn Leventm 'nin yazdığı şekilde zaten alıyorsunuz. Ayrıca Girdiğiniz değerlerin TextBoxlarla birlikte Hücrelerde Anında görünmesini isterseniz. Kod: Private Sub TextBox1_Change() Range("A1").Select [a1] = TextBox1.Value TextBox3.Value = Val(TextBox1.Value) + Val(TextBox2.Value) End Sub Private Sub TextBox2_Change() Range("A2").Select [a2] = TextBox2.Value TextBox3.Value = Val(TextBox1.Value) + Val(TextBox2.Value) End Sub Private Sub TextBox3_Change() Range("A3").Select [a3] = TextBox3.Value End Sub

textbox içeriğini kopyalamak

ID : 2112
ISLEM : textbox içeriğini kopyalamak
MAKRO KODU : If TextBox1 <> Empty Then TextBox1.SelStart = 0 TextBox1.SelLength = TextBox1.TextLength TextBox1.Copy MyData.GetFromClipboard MsgBox "TextBox1 icerigi hafizaya kopyalandı...." End If

textbox içinde günün tarihi

ID : 2113
ISLEM : textbox içinde günün tarihi
MAKRO KODU : Private Sub TextBox3_Change() TextBox3 = Format(TextBox3, "mm""/""dd""/""yyyy") End Sub

textbox içine gelindiğinde renklendirme

ID : 2114
ISLEM : textbox içine gelindiğinde renklendirme
MAKRO KODU : Private Sub TextBox2_Enter() TextBox1.BackColor = &HFFFF00 End Sub Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean) TextBox1.BackColor = vbWhite End Sub Private Sub TextBox4_Enter() TextBox3.BackColor = &HFFFF00 End Sub Private Sub TextBox4_Exit(ByVal Cancel As MSForms.ReturnBoolean) TextBox3.BackColor = vbWhite End Sub Private Sub TextBox6_Enter() TextBox5.BackColor = &HFFFF00 End Sub Private Sub TextBox6_Exit(ByVal Cancel As MSForms.ReturnBoolean) TextBox5.BackColor = vbWhite End Sub Private Sub TextBox8_Enter() TextBox7.BackColor = &HFFFF00 End Sub Private Sub TextBox8_Exit(ByVal Cancel As MSForms.ReturnBoolean) TextBox7.BackColor = vbWhite End Sub

textbox karakter kısıtlaması

ID : 2115
ISLEM : textbox karakter kısıtlaması
MAKRO KODU : Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean) If Len(TextBox1) < 11 Then MsgBox "EKSİK KARAKTER GİRİŞİ !" & vbCrLf & "EN AZ 11 KARAKTER GİREBİLİRSİNİZ.", vbCritical Cancel = True ElseIf Len(TextBox1) > 11 Then MsgBox "FAZLA KARAKTER GİRİŞİ !" & vbCrLf & "EN FAZLA 11 KARAKTER GİREBİLİRSİNİZ.", vbCritical Cancel = True Else Cancel = False End If End Sub

textbox kutusu görünmez ise görünür yap

ID : 2116
ISLEM : textbox kutusu görünmez ise görünür yap
MAKRO KODU : Private Sub CommandButton1_Click() 'Eğer text kutusu görünmez ise görünür yap If TextBox1.Visible = False Then TextBox1.Visible = True: GoTo 10 'Eğer text kutusu görünürse görünmez yap. If TextBox1.Visible = True Then TextBox1.Visible = False: GoTo 10 10: End Sub

textbox lara girilen rakamlarin para bazinda gösterilmesi

ID : 2117
ISLEM : textbox lara girilen rakamlarin para bazinda gösterilmesi
MAKRO KODU : Private Sub CommandButton1_Click() Range("a1").Select ActiveCell.Formula = TextBox1 End Sub

textbox nesnesi tab tuşuyla veya mausla seçildiğinde yani aktif olduğunda renk değiştirme

ID : 2118
ISLEM : textbox nesnesi tab tuşuyla veya mausla seçildiğinde yani aktif olduğunda renk değiştirme
MAKRO KODU : Private Sub TextBox1_Enter() TextBox1.BackColor = vbYellow End Sub Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean) TextBox1.BackColor = vbWhite End Sub

textbox ta 2 karakterden fazla yazı yazılırsa diğer textbox a geçer

ID : 2119
ISLEM : textbox ta 2 karakterden fazla yazı yazılırsa diğer textbox a geçer
MAKRO KODU : Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) Select Case Len(TextBox1.Value) Case Is >= 2 TextBox2.SetFocus Case Else TextBox2.Value = "" End Select End Sub

textbox ta 2 karakterden fazla yazı yazılırsa diğer textbox ta mesaj verir

ID : 2120
ISLEM : textbox ta 2 karakterden fazla yazı yazılırsa diğer textbox ta mesaj verir
MAKRO KODU : Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) If Len(TextBox1.Value) >= 2 Then TextBox2.Value = "Artık ben aktifim" Else TextBox2.Value = "" End If End Sub

textbox ta 2 karakterden fazla yazı yazılırsa diğer textbox ta mesaj verir

ID : 2121
ISLEM : textbox ta 2 karakterden fazla yazı yazılırsa diğer textbox ta mesaj verir
MAKRO KODU : Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) Select Case Len(TextBox1.Value) Case Is >= 2 TextBox2.Value = "Artık ben aktifim" Case Else TextBox2.Value = "" End Select End Sub

textbox ta binlik ayıracı

ID : 2122
ISLEM : textbox ta binlik ayıracı
MAKRO KODU : Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean) TextBox1 = Format(TextBox1, "##,##.00") End Sub

textbox ta virgul kullanmasin nokta ile giris yapsin ve noktadan once ve sonra 2 rakam girilsin.

ID : 2123
ISLEM : textbox ta virgul kullanmasin nokta ile giris yapsin ve noktadan once ve sonra 2 rakam girilsin.
MAKRO KODU : Private Sub TextBox1_Change() uz = Len(TextBox1) par = Right(TextBox1, 1) If uz < 3 And IsNumeric(par) = False Or uz > 5 Then SendKeys "{bs}" If uz = 3 And par <> "." Then SendKeys "{bs}" If uz > 3 And IsNumeric(par) = False Then SendKeys "{bs}" End Sub

textbox taki boşlukları aldırma

ID : 2124
ISLEM : textbox taki boşlukları aldırma
MAKRO KODU : Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) If KeyAscii = 32 Then KeyAscii = 0 End If End Sub

textbox tarih formatı

ID : 2125
ISLEM : textbox tarih formatı
MAKRO KODU : Private Sub TextBox1_Change() With TextBox1 .SelLength = 1 If .SelText = "." Then .SelStart = .SelStart + 1 .SelLength = 1 End If End With End Sub Private Sub UserForm_Initialize() With TextBox1 .MaxLength = 10 .EnterFieldBehavior = fmEnterFieldBehaviorRecallSelection .Text = "##.##.####" .SelStart = 0 .SelLength = 1 End With End Sub

textbox tarih örneği

ID : 2126
ISLEM : textbox tarih örneği
MAKRO KODU : Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean) If Right(TextBox1.Value, 4) >= 2000 Then TextBox1.Value = Format(TextBox1.Value, "dd""/""mm""/""yyyy") Else MsgBox "hatalı" End If End Sub

textbox un rengi değişsin

ID : 2127
ISLEM : textbox un rengi değişsin
MAKRO KODU : Private Sub TextBox1_Enter() TextBox1.BackColor = &HFF& End Sub

textbox ve comboboxtakileri sayfaya sıralı kaydetme

ID : 2128
ISLEM : textbox ve comboboxtakileri sayfaya sıralı kaydetme
MAKRO KODU : Private Sub CommandButton1_Click() Application.ScreenUpdating = False satir = WorksheetFunction.CountA(Sheets("TABLO").Range("A1:A65536")) + 1 'VERİ sayfasında, a kolonundaki son dolu hücreden sonraki satir Sheets("TABLO").Cells(satir, 1) = ComboBox1.Value Sheets("TABLO").Cells(satir, 2) = TextBox1.Value Sheets("TABLO").Cells(satir, 3) = TextBox2.Value Sheets("TABLO").Cells(satir, 4) = TextBox3.Value Sheets("TABLO").Cells(satir, 5) = TextBox4.Value ComboBox1.Value = "" TextBox1.Value = "" TextBox2.Value = "" TextBox3.Value = "" TextBox4.Value = "" End Sub

textbox yazılan kelimelerin ilk harfini büyük yazmak

ID : 2129
ISLEM : textbox yazılan kelimelerin ilk harfini büyük yazmak
MAKRO KODU : Public Function AutoType(c As Control, KeyAscii As Integer) As Integer AutoType = KeyAscii If KeyAscii > 95 And KeyAscii < 123 Then If c.SelStart = 0 Then AutoType = AutoType - 32 ElseIf Mid$(c.Text, c.SelStart, 1) < "!" Then AutoType = AutoType - 32 End If End If End Function Private Sub Text1_KeyPress(KeyAscii As Integer) KeyAscii = AutoType(Screen.ActiveControl, KeyAscii) End Sub

textbox`a metin girişinde parağraf yapabilirmiyiz enter

ID : 2130
ISLEM : textbox`a metin girişinde parağraf yapabilirmiyiz enter
MAKRO KODU : Private Sub UserForm_Initialize() With TextBox1 .EnterKeyBehavior = True .TabKeyBehavior = True .MultiLine = True End With End Sub

* Görseller ve İçerik tekif hakkına sahip olabilir