AccessTr.neT
Liste Alma Sorunu - Baskı Önizleme

+- AccessTr.neT (https://accesstr.net)
+-- Forum: Microsoft Excel (https://accesstr.net/forum-microsoft-excel.html)
+--- Forum: Excel Cevaplanmış Soruları (https://accesstr.net/forum-excel-cevaplanmis-sorulari.html)
+--- Konu Başlığı: Liste Alma Sorunu (/konu-liste-alma-sorunu.html)

Sayfalar: 1 2 3 4 5 6


RE: Liste Alma Sorunu - berduş - 11/05/2020

tam olarak sisteminiz anlayamadım ama aşağıdaki kod işinize yarayabilir
Private Sub UserForm_Initialize()
Dim Sql As String
Dim Cn As Object
Dim Rs As Object
Dim SyfEkle As String

SyfEkle = ""
For Each syf In Worksheets
If LCase(syf.Name) = LCase(syf.Range("A1").Value) Then
SyfEkle = SyfEkle & ",'" & syf.Name & "'"
End If
Next syf
SyfEkle = Mid(SyfEkle, 2)
Debug.Print "SyfEkle init", SyfEkle
Set Cn = CreateObject("Adodb.Connection")
Cn.ConnectionString = "provider=Microsoft.ACE.OLEDB.12.0;data source=" & _
ThisWorkbook.FullName & ";extended properties=""excel 8.0;hdr=no"""
Cn.Open

SQL = "select * from [liste$A2Lol] where [F1]<>'' and [F1] in (" & SyfEkle & ") order by [F1]"
Set Rs = CreateObject("adodb.recordset")
Rs.Open SQL, Cn, 3, 1
ListBox1.Column = Rs.GetRows 'RowSource = "liste!a1:F65536"
Rs.Close
Set Rs = Nothing
End Sub



RE: Liste Alma Sorunu - m_demir - 11/05/2020

Hocan mesaj7 deki kodu ekleyince hata veriyor.


RE: Liste Alma Sorunu - berduş - 12/05/2020

dosyanızı indirip UserForm_Initialize() fonksiyonunu silip 7. Mesajdaki kodu ekledim, başka hiçbir şey yapmadan form1i açıp rapor al düğmesine bastım hata vermeden çalıştı


RE: Liste Alma Sorunu - feraz - 12/05/2020

Alttaki gibi değiştiriseniz hen 2.satırdan başlar hemde sayfa1 harici listelenir.Alttoplam olayını tam açıklamanız gerekmektedir.
Private Sub UserForm_Initialize()
    Dim son As Integer
   
    ActiveSheet.Unprotect "4455"
    Application.ScreenUpdating = False
    Set SÝ = Sheets("liste")
    SÝ.[A2Lol1000].ClearContents
    SAT = 1
    For Z = 2 To Sheets.Count
    If LCase(Sheets(Z).Name) <> "sayfa1" Then
    SÝ.Cells(SAT + 1, 1) = Sheets(Z).[a1].Value
    SÝ.Cells(SAT + 1, 2) = Sheets(Z).[G5].Value
    SÝ.Cells(SAT + 1, 3) = Sheets(Z).[ý5].Value
    SÝ.Cells(SAT + 1, 4) = Sheets(Z).[K4].Value
   
    SAT = SAT + 1
    End If
Next
    'son = Cells(65536, "f").End(xlUp).Row + 1
'Cells(son, "g") = WorksheetFunction.Sum(Range("f3:f65536"))
'Cells(son, "ý") = WorksheetFunction.Sum(Range("e3:e65536"))
'Cells(son, "ý") = WorksheetFunction.Sum(Range("d3:d65536"))

    Application.ScreenUpdating = True
    'MsgBox "AKTARMA ÝÞLEMÝ TAMAMLANMIÞTIR." & vbCrLf & vbCrLf
    ActiveSheet.Protect "4455"
   
    son = Sheets("liste").Cells(Rows.Count, 1).End(3).Row
    If son > 1 Then ListBox1.RowSource = "liste!A2:F" & son
End Sub



RE: Liste Alma Sorunu - m_demir - 12/05/2020

Hocam UserForm3 de ve liste sayfasında alt toplamları almıyor.


RE: Liste Alma Sorunu - feraz - 12/05/2020

(12/05/2020, 00:11)m_demir yazdı: Hocam UserForm3 de ve liste sayfasında alt toplamları almıyor.
Alttoplamlar nereye alınacak sorun bu.Alttoplamlar diye alan yada textbox gibi şeyler yok.