- Katılım
- 12 Eylül 2004
- Mesajlar
- 885
- Excel Vers. ve Dili
- Excel 2019 Türkçe (Ev)
Excel 2013 Türkçe (Okul)
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
[B]Private Sub CommandButton3_Click()[/B]
[B][COLOR="Red"]son = ListBox1.ListCount - 1[/COLOR][/B]
With Sheets("VTT")
[COLOR="red"][B].[D6][/B] = CDate(TextBox3.Value):[B] .[D7][/B] = Format(TextBox6.Value, "hh:mm")
[B].[A13][/B] = TextBox1.Text:[B] .[A22] [/B]= TextBox4.Text:[B] .[A50][/B] = TextBox5.Text
[B].[B11][/B] = "Veli Toplantısı " & .[D6] & " " & Format(.[D6], "dddd") & " günü saat " & _
Format(TextBox6.Value, "hh:mm") & " 'da aşağıdaki gündem maddelerini"
[B].[A12][/B] = "görüşmek üzere gerçekleştirilmiş ve aşağıdaki kararlar alınmıştır."[/COLOR]
For a = 0 To ListBox1.ListCount - 1
[COLOR="Red"][B] If a > son Then Exit For[/B][/COLOR]
If ListBox1.Selected(a) = True Then
vttsat = .Cells(Rows.Count, 2).End(3).Row + 1
.Cells(vttsat, 2) = ListBox1.List(a)
satır = WorksheetFunction.Match(ListBox1.List(a), Sheets("VERİ").Range("C:C"), 0)
.Cells(vttsat, "A") = vttsat - 61
[B][COLOR="Blue"] ListBox1.Selected(a) = False[/COLOR][/B]
[B][COLOR="Red"] ListBox1.RemoveItem a[/COLOR][/B]
[COLOR="red"][B] son = son - 1: a = a - 1[/B][/COLOR]
End If
Next
[COLOR="Red"] TextBox1 = "": TextBox2 = "": TextBox3 = "": TextBox4 = "": TextBox5 = "": TextBox6 = ""[/COLOR]
End With
[B]End Sub
Private Sub UserForm_Initialize()[/B]
ListBox1.ListStyle = fmListStyleOption
ListBox1.MultiSelect = fmMultiSelectMulti
With Sheets("VERİ")
For sat = 2 To .Cells(Rows.Count, 1).End(3).Row
If .Cells(sat, 1) > 0 Then ListBox1.AddItem .Cells(sat, 3)
Next
End With
[B]End Sub[/B]
Sanırım başka çare kalmadı (Çünkü satır yüksekliğinin sınırı varmış :=)) Ömer bey. Belirttiğiniz şekilde son eklediğim dosya üzerinde yol gösterirseniz sevinirim.Bence birleştirilmiş çoklu satır/çoklu sütun için satır yüksekliği ayarlama işlemi yerine;
formdaki TextBox'a yazılan metni,
-- satır başı kriterine göre ayrı satırlara alt alta yazdırmak,
-- ardından bu satırlarda METNİ KAYDIR özelliği üzerinden satır yüksekliğini ayarlamak
daha doğru olur diye düşünüyorum.
.
*** BURDAN AŞAĞISI İSİM LİSTELEME / LİSTBOX'TAN SİLME
son = ListBox1.ListCount
baş = karsat + ak + 3
For a = 0 To ListBox1.ListCount
If a > son Then Exit For
If ListBox1.Selected(a) = True Then
vttsat = .Cells(Rows.Count, 2).End(3).Row + 1
.Cells(vttsat, 2) = ListBox1.List(a)
Satır = WorksheetFunction.Match(ListBox1.List(a), Sheets("VERİ").Range("C:C"), 0)
.Cells(vttsat, "A") = vttsat - baş
ListBox1.RemoveItem a
son = son - 1: a = a - 1
End If
Next
TextBox1 = "": TextBox2 = "": TextBox3 = "": TextBox4 = "": TextBox5 = "": TextBox6 = "": TextBox7 = ""
End With
If ListBox1.Selected(a) = True Then
'*** BURDAN AŞAĞISI İSİM LİSTELEME / LİSTBOX'TAN SİLME
[B][COLOR="Red"]Application.CutCopyMode = False[/COLOR][/B]
son = ListBox1.ListCount
baş = karsat + ak + 3
For a = 0 To ListBox1.ListCount
[COLOR="red"][B] If ListBox1.Selected(a) = False Then seç = seç + 1
If seç = ListBox1.ListCount Then GoTo 100[/B][/COLOR]
If a > son Then Exit For
If ListBox1.Selected(a) = True Then
vttsat = .Cells(Rows.Count, 2).End(3).Row + 1
.Cells(vttsat, 2) = ListBox1.List(a)
satır = WorksheetFunction.Match(ListBox1.List(a), Sheets("VERİ").Range("C:C"), 0)
.Cells(vttsat, "A") = vttsat - baş
ListBox1.RemoveItem a
son = son - 1: a = a - 1
End If
Next
[B][COLOR="Red"]100:[/COLOR][/B]
TextBox1 = "": TextBox2 = "": TextBox3 = "": TextBox4 = "": TextBox5 = "": TextBox6 = "": TextBox7 = ""
End With
Bu satırı aşağıdaki satırla değiştiriniz.
bununla değiştiriniz.Kod:For a = 0 To ListBox1.ListCount
Kod:For a = 0 To ListBox1.ListCount [B][COLOR="Red"]-1[/COLOR][/B]
Çalışma sayfası açıkken sorun yok. Ömer Bey'in son eklediği kodlar çalışıyor hatasız. Ancak form üzerinde işlem yaparken (çalışma sayfası arka planda yok) kod hata veriyor.
For a = ListBox1.ListCount -1 to 0 step -1