[]
makro sevenler-her workbooktaki sheet1 i seçmek
arkadaşlar yaklaşık 30 tane excelim her excelde de sheet1 2 3 isimli 3 sheetim var.
ben her workbooktaki sheet1 i ana workbookta toplamak istiyorum.
aşağıdaki formül workbooktaki bütün sheetleri alıyor.
Sub GetSheets()
Path = "C:\Users\dt\Desktop\dt kte\"
Filename = Dir(Path & "*.xls")
Do While Filename <> ""
Workbooks.Open Filename:=Path & Filename, ReadOnly:=True
For Each Sheet In ActiveWorkbook.Sheets
Sheet.Copy After:=ThisWorkbook.Sheets(1)
Next Sheet
Workbooks(Filename).Close
Filename = Dir()
Loop
End Sub
nasıl sadece sheet1 i almasını sağlarım.
ben her workbooktaki sheet1 i ana workbookta toplamak istiyorum.
aşağıdaki formül workbooktaki bütün sheetleri alıyor.
Sub GetSheets()
Path = "C:\Users\dt\Desktop\dt kte\"
Filename = Dir(Path & "*.xls")
Do While Filename <> ""
Workbooks.Open Filename:=Path & Filename, ReadOnly:=True
For Each Sheet In ActiveWorkbook.Sheets
Sheet.Copy After:=ThisWorkbook.Sheets(1)
Next Sheet
Workbooks(Filename).Close
Filename = Dir()
Loop
End Sub
nasıl sadece sheet1 i almasını sağlarım.
emin değilim, deneyemedim ama aşağıda düzenlediğim şekilde çalışacaktır muhtemelen.
Sub GetSheets()
Path = "C:\Users\dt\Desktop\dt kte\"
Filename = Dir(Path & "*.xls")
Do While Filename <> ""
Workbooks.Open Filename:=Path & Filename, ReadOnly:=True
ActiveWorkbook.Sheets(1).Copy After:=ThisWorkbook.Sheets(1)
Workbooks(Filename).Close
Filename = Dir()
Loop
End Sub
Sub GetSheets()
Path = "C:\Users\dt\Desktop\dt kte\"
Filename = Dir(Path & "*.xls")
Do While Filename <> ""
Workbooks.Open Filename:=Path & Filename, ReadOnly:=True
ActiveWorkbook.Sheets(1).Copy After:=ThisWorkbook.Sheets(1)
Workbooks(Filename).Close
Filename = Dir()
Loop
End Sub
- lemmiwinks (12.11.14 21:20:26)
1