- Katılım
- 17 Nisan 2013
- Mesajlar
- 101
- Excel Vers. ve Dili
- 2007 Microsoft Office Türkçe
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Private Sub CommandButton1_Click()
Range("b2,b3:b155").ClearContents
Range("b2").Value = ComboBox1.Value
Set s1 = Sheets("ana sayfa")
sat = ListBox1.ListCount [COLOR="Red"]+ 2[/COLOR]
sut = ListBox1.ColumnCount
Range("b5").Select
s1.Range(s1.Cells(3, "a"), s1.Cells(sat, sut)) = ListBox1.List
Range("b5").Select
End Sub
Merhaba,
Kod:Private Sub CommandButton1_Click() Range("b2,b3:b155").ClearContents Range("b2").Value = ComboBox1.Value Set s1 = Sheets("ana sayfa") sat = ListBox1.ListCount [COLOR="Red"]+ 2[/COLOR] sut = ListBox1.ColumnCount Range("b5").Select s1.Range(s1.Cells(3, "a"), s1.Cells(sat, sut)) = ListBox1.List Range("b5").Select End Sub
kod satırındaki kırmızı yazıyı ekleyerk denermisiniz
Private Sub CommandButton1_Click()
Dim s1 As Worksheet, s2 As Worksheet, i As Long, sat As Long
ListBox1.RowSource = ""
Set s1 = Sheets("ana sayfa")
Set s2 = Sheets("veri")
s1.Range("A3:A" & Rows.Count & ",b3:b155").ClearContents
s1.Range("b2").Value = ComboBox1.Value
s2.Range("B3:D3").AutoFilter
s2.Range("B3").AutoFilter field:=1, Criteria1:=ComboBox1.Value
s2.Range("B3").CurrentRegion.Offset(1, 2).Copy s1.Range("B3")
ListBox1.RowSource = "'ana sayfa'!B3:B" & s1.Cells(Rows.Count, "B").End(xlUp).Row
s2.Range("B2").AutoFilter
sat = s1.Cells(Rows.Count, "B").End(xlUp).Row
For i = 3 To sat
s1.Cells(i, "A").Value = i - 2
Next i
End Sub
Dosyanız ektedir.
Kod:Private Sub CommandButton1_Click() Dim s1 As Worksheet, s2 As Worksheet ListBox1.RowSource = "" Set s1 = Sheets("ana sayfa") Set s2 = Sheets("veri") s1.Range("b2,b3:b155").ClearContents s1.Range("b2").Value = ComboBox1.Value s2.Range("B3:D3").AutoFilter s2.Range("B3").AutoFilter field:=1, Criteria1:=ComboBox1.Value s2.Range("B3").CurrentRegion.Offset(1, 2).Copy s1.Range("B3") ListBox1.RowSource = "'ana sayfa'!B3:B" & s1.Cells(Rows.Count, "B").End(xlUp).Row s2.Range("B2").AutoFilter End Sub
kod için çok teşekkürler .. "ana sayfa" ya sıra numarası verdiriyorum fakat aktar işleminden sonra sıra numarası oluşmuyor. B sütununda değişiklik yaptıktan sonra sıra numaraları geliyor. acaba bu sorunu çözebilirmisiniz.
dosyayı güncelledim.
4 nolu mesajdan indirebilirsiniz.![]()
dosyayı güncelledim.
4 nolu mesajdan indirebilirsiniz.![]()