- Katılım
- 19 Ağustos 2006
- Mesajlar
- 601
- Excel Vers. ve Dili
- Microsoft® Excel® Microsoft 365 için MSO /64 bit /Türkçe
inceledim fakat benim istediğim sonuç bu değil ellerinize sağlık bu çalışma da çok iyi olmuş. Benim istediğim şu
catalinastrap arkadaşımızın yaptığı çalışma tek sayfada çok güzel oldu ben bunu tek makrado 7 sayfaya birden yapıp bulduğu maliyeti 50 den fazla olan malzemeleri bir sayfada toplamak
aşağıdaki kod işinizi çözecektir
Sub CopyRowsBasedOnCriteria()
Dim wsSource As Worksheet
Dim wsSummary As Worksheet
Dim lastRow As Long
Dim i As Long
Dim summaryRow As Long
Dim headerCopied As Boolean
Set wsSummary = ThisWorkbook.Sheets.Add
wsSummary.Name = "Özet Sayfa"
summaryRow = 1
headerCopied = False
For Each wsSource In ThisWorkbook.Sheets
If wsSource.Name <> "Özet Sayfa" Then
lastRow = wsSource.Cells(wsSource.Rows.Count, "H").End(xlUp).Row
If Not headerCopied Then
wsSource.Rows(1).Copy wsSummary.Rows(summaryRow)
summaryRow = summaryRow + 1
headerCopied = True
End If
For i = 2 To lastRow
If wsSource.Cells(i, 8).Value >= 50 Then
wsSource.Rows(i).Copy wsSummary.Rows(summaryRow)
summaryRow = summaryRow + 1
End If
Next i
End If
Next wsSource
End Sub