Kalau begitu ......
sebetulnya anda hanya memerlukan sheet baru yang berisi gabungan
semua data jurnal di berbagai sheet "Jurnal X" dlm workbook tsb.
Sisipkan sebuah worksheet baru, beri mana 'GabJurnal'
Pekerjaan ini cukup dilakukan sekali saja.
Dengan men-ceklik sebuah tombol; gabungan jurnal pun langsung terwujud
tak peduli berapa banyak / lembar sheet "Jurnal X"-nya
(sudah termasuk bonus: mengurutkan jurnal byTanggal)
Sub ctv_MergeJurnal()
'---------------------------------
' siti Vi / 3 feb 2010
' menggabung jurnal di tiap sheets
'---------------------------------
Dim JurPart As Range
Dim JurRows As Long
Dim NewPos As Long
Dim Ws As Worksheet
Dim nW As Integer
Sheets("GabJurnal").Activate
NewPos = 1
Cells.Delete Shift:=xlUp
For Each Ws In Worksheets
If LCase(Left(Ws.Name, 6)) = "jurnal" Then
nW = nW + 1
Set JurPart = Ws.Cells(1).CurrentRegion
JurRows = JurPart.Rows.Count
If nW > 1 Then
JurRows = JurRows - 1
Set JurPart = JurPart.Offset(1, 0).Resize(JurRows, JurPart.Columns.Count)
End If
JurPart.Copy
Sheets("GabJurnal").Cells(NewPos, 1).PasteSpecial xlPasteValuesAndNumberFormats
NewPos = NewPos + JurRows
End If
Next Ws
Application.CutCopyMode = False
'-----------
' siti Vi / 3 feb 2010
' menggabung jurnal di tiap sheets
'-----------
Dim JurRows As Long
Dim NewPos As Long
Dim Ws As Worksheet
Dim nW As Integer
Sheets("GabJurnal"
NewPos = 1
Cells.Delete Shift:=xlUp
For Each Ws In Worksheets
If LCase(Left(Ws.
nW = nW + 1
Set JurPart = Ws.Cells(1).
JurRows = JurPart.Rows.
If nW > 1 Then
JurRows = JurRows - 1
Set JurPart = JurPart.Offset(
End If
JurPart.Copy
Sheets("GabJurnal"
NewPos = NewPos + JurRows
End If
Next Ws
Application.
Range(Columns("A:A"), Columns("A:A").End(xlToRight)).Select
Selection.Columns.AutoFit
Cells(1).CurrentRegion.Sort _
Key1:=Range("A2"), Order1:=xlAscending, _
Key2:=Range("D2"), Order2:=xlAscending, _
Key3:=Range("E2"), Order3:=xlDescending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal
Cells(1).Select
End Sub
Selection.Columns.
Cells(1).CurrentReg
Key1:=Range(
Key2:=Range(
Key3:=Range(
Header:=xlGuess, OrderCustom:
Orientation:
DataOption1:
DataOption2:
DataOption3:
Cells(1).Select
End Sub
----- Original Message -----From: Wei CiaSent: Tuesday, February 02, 2010 10:50 AMSubject: ]] XL-mania [[ When Two Become OneDear Excellers'
Mohon bantuannya!
Biasanya saya membuat Buku Besar hanya mengambil data Jurnal yang ada di 1 sheetdengan menggunakan gabungan fungsi Index, Small, If & Row.
Permasalahan sekarang data Jurnal nya terdiri atas beberapa sheet,sudah saya coba2 tapi belum ketemu solusinya.Mohon bantuan excellers' atas permasalahan ini.
Regards & Thanks!
Billy
__._,_.___
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| Member ke 13,013 siapa ya? Sini mau dikirimin coklat :D |
| Member ke 31,031 dapet iPod dehh.... :D :D :D |
| http://www.facebook.com/group.php?gid=37671048001&ref=mf |
+-------------------------------------------------------------------+
| DILARANG : MLM, money game, OOT, iklan tanpa izin, SARA, testing, |
| pembicaraan pribadi, one line message, melecehkan, tidak sopan. |
+-------------------------------------------------------------------+
| Buat subjek yang kreatif, jangan : "tanya", "help", "mohon bantu" |
| Usahakan besar attachment < 200 kb. Gunakan winzip jika perlu. |
+-------------------------------------------------------------------+
| Ajak teman-teman Anda bergabung dengan mengirim e-mail kosong ke |
| XL-mania-subscribe@yahoogroups.com atau kirimkan mereka file dari |
| http://groups.yahoo.com/group/XL-mania/files/Promotion/ |
+-------------------------------------------------------------------+
| Berikan testimoni di : http://www.friendster.com/xlmania atau... |
| http://www.xl-mania.com/2008/06/testimoni-xl-mania.html |
+-------------------------------------------------------------------+
| Message lama ada di : |
| http://groups.yahoo.com/group/XL-mania/messages [perlu yahoo id] |
| http://www.mail-archive.com/xl-mania@yahoogroups.com |
+-------------------------------------------------------------------+
| Member ke 13,013 siapa ya? Sini mau dikirimin coklat :D |
| Member ke 31,031 dapet iPod dehh.... :D :D :D |
| http://www.facebook.com/group.php?gid=37671048001&ref=mf |
+-------------------------------------------------------------------+
| DILARANG : MLM, money game, OOT, iklan tanpa izin, SARA, testing, |
| pembicaraan pribadi, one line message, melecehkan, tidak sopan. |
+-------------------------------------------------------------------+
| Buat subjek yang kreatif, jangan : "tanya", "help", "mohon bantu" |
| Usahakan besar attachment < 200 kb. Gunakan winzip jika perlu. |
+-------------------------------------------------------------------+
| Ajak teman-teman Anda bergabung dengan mengirim e-mail kosong ke |
| XL-mania-subscribe@yahoogroups.com atau kirimkan mereka file dari |
| http://groups.yahoo.com/group/XL-mania/files/Promotion/ |
+-------------------------------------------------------------------+
| Berikan testimoni di : http://www.friendster.com/xlmania atau... |
| http://www.xl-mania.com/2008/06/testimoni-xl-mania.html |
+-------------------------------------------------------------------+
| Message lama ada di : |
| http://groups.yahoo.com/group/XL-mania/messages [perlu yahoo id] |
| http://www.mail-archive.com/xl-mania@yahoogroups.com |
+-------------------------------------------------------------------+
.
__,_._,___
Nenhum comentário:
Postar um comentário