- Katılım
- 27 Ocak 2005
- Mesajlar
- 88
- Excel Vers. ve Dili
- Excel 2010 TR
- Altın Üyelik Bitiş Tarihi
- 25/04/2023
Aşağıdaki makro ile dosya içerisindeki sayfalardan verileri alıp yatay olarak Sayfa 1 e aktarıyorum.
1.sorum dosya içerisindeki bazı sayfalardan veri almasın istiyorum.
Örneğin Ahmet isimli sayfadan veri almasın.... gibi
2.Sorum verileri satır olarak nasıl aktarabilirim.
örneğin a sayfasındaki verileri Sayfa1 a1:g1
b sayfasındaki verileri Sayfa1 a2:g2
şeklinde.
Sub getir()
Application.ScreenUpdating = False
On Error Resume Next
Set S1 = ThisWorkbook.Worksheets("Sayfa1")
S1.Range("b1:ıv8").ClearContents
S1.Range("b1:ıv8").Borders.LineStyle = xlNone
süt = 2
For Sayfa = 1 To Sheets.Count
If Sheets(Sayfa).Name <> S1.Name Then
Set s2 = ThisWorkbook.Worksheets(Sheets(Sayfa).Name)
S1.Cells(1, süt) = s2.Cells(4, "f")
S1.Cells(2, süt) = s2.Cells(8, "g")
S1.Cells(3, süt) = s2.Cells(9, "g")
S1.Cells(4, süt) = s2.Cells(14, "g")
S1.Cells(5, süt) = s2.Cells(15, "g")
S1.Cells(6, süt) = s2.Cells(18, "g")
S1.Cells(7, süt) = s2.Cells(19, "g")
S1.Cells(8, süt) = s2.Cells(24, "g")
S1.Cells(2, süt).Borders.LineStyle = xlContinuous
S1.Cells(3, süt).Borders.LineStyle = xlContinuous
S1.Cells(4, süt).Borders.LineStyle = xlContinuous
S1.Cells(5, süt).Borders.LineStyle = xlContinuous
S1.Cells(6, süt).Borders.LineStyle = xlContinuous
S1.Cells(7, süt).Borders.LineStyle = xlContinuous
S1.Cells(8, süt).Borders.LineStyle = xlContinuous
S1.Cells(9, süt).Borders.LineStyle = xlContinuous
süt = süt + 1
End If
Next Sayfa
End Sub
1.sorum dosya içerisindeki bazı sayfalardan veri almasın istiyorum.
Örneğin Ahmet isimli sayfadan veri almasın.... gibi
2.Sorum verileri satır olarak nasıl aktarabilirim.
örneğin a sayfasındaki verileri Sayfa1 a1:g1
b sayfasındaki verileri Sayfa1 a2:g2
şeklinde.
Sub getir()
Application.ScreenUpdating = False
On Error Resume Next
Set S1 = ThisWorkbook.Worksheets("Sayfa1")
S1.Range("b1:ıv8").ClearContents
S1.Range("b1:ıv8").Borders.LineStyle = xlNone
süt = 2
For Sayfa = 1 To Sheets.Count
If Sheets(Sayfa).Name <> S1.Name Then
Set s2 = ThisWorkbook.Worksheets(Sheets(Sayfa).Name)
S1.Cells(1, süt) = s2.Cells(4, "f")
S1.Cells(2, süt) = s2.Cells(8, "g")
S1.Cells(3, süt) = s2.Cells(9, "g")
S1.Cells(4, süt) = s2.Cells(14, "g")
S1.Cells(5, süt) = s2.Cells(15, "g")
S1.Cells(6, süt) = s2.Cells(18, "g")
S1.Cells(7, süt) = s2.Cells(19, "g")
S1.Cells(8, süt) = s2.Cells(24, "g")
S1.Cells(2, süt).Borders.LineStyle = xlContinuous
S1.Cells(3, süt).Borders.LineStyle = xlContinuous
S1.Cells(4, süt).Borders.LineStyle = xlContinuous
S1.Cells(5, süt).Borders.LineStyle = xlContinuous
S1.Cells(6, süt).Borders.LineStyle = xlContinuous
S1.Cells(7, süt).Borders.LineStyle = xlContinuous
S1.Cells(8, süt).Borders.LineStyle = xlContinuous
S1.Cells(9, süt).Borders.LineStyle = xlContinuous
süt = süt + 1
End If
Next Sayfa
End Sub