Tecnologia, programação e muito Visual FoxPro.

segunda-feira, 31 de janeiro de 2011

Re: ]] XL-mania [[ klasifikasi jenis kelamin ke sheet yang berbeda sekaligus sort by date

 

kalo boleh pakai makro, salah satu codingnya mungkin spt ini


Sub PisahkanTabel(Kriteria As String)
   ' declaring
   Dim dTabel As Range
   Dim dHasil As Range
   Dim r As Long
   Dim n As Long
  
   ' assignments...
   Set dTabel = Sheets("master").Range("A2").CurrentRegion.Offset(1, 0)
   Set dTabel = dTabel.Resize(dTabel.Rows.Count - 1, dTabel.Columns.Count)
   If Kriteria = "L" Then
      Set dHasil = Sheets("Laki-laki").Range("A4").CurrentRegion
   ElseIf Kriteria = "P" Then
      Set dHasil = Sheets("Perempuan").Range("A4").CurrentRegion
   End If
   dHasil.Offset(1, 0).ClearContents
   Set dHasil = dHasil(2, 1)
  
   ' posting
   For n = 1 To dTabel.Rows.Count
      If dTabel(n, 3) = Kriteria Then
         dTabel(n, 1).Resize(1, dTabel.Columns.Count).Copy
         r = r + 1
         dHasil(r, 1).PasteSpecial xlPasteValuesAndNumberFormats
      End If
   Next n
   Application.CutCopyMode = False
   Set dHasil = dHasil.CurrentRegion
  
   ' sorting
   With dHasil
      .CurrentRegion.Select
      .Parent.Sort.SortFields.Clear
      .Parent.Sort.SortFields.Add _
         Key:=Range("A4"), _
         SortOn:=xlSortOnValues, _
         Order:=xlAscending, _
         DataOption:=xlSortNormal
      With .Parent.Sort
         .SetRange dHasil
         .Header = xlYes
         .MatchCase = False
         .Orientation = xlTopToBottom
         .SortMethod = xlPinYin
         .Apply
      End With
   End With
  
End Sub

kalau ndak boleh, ya tinggal dihapus saja...



2011/1/27 sajjad aji <aji_special@yahoo.com>
>
> Selamat sore para master excell,
> mohon pencerahannya untuk mengklasifikasikan jenis kelamin dari sheet master
> ke sheet yang berbeda, sekaligus nanti hasilnya di sort by date...
> Terima kasih atas pencerahannya...
> Aji (aji_special@yahoo.com)

__._,_.___
Recent Activity:
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| "if you are the most valuable assets, you will show up on the     |
| balance sheet..." - oNo Wiqe                                      |
| 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              |
+-------------------------------------------------------------------+
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.


Find useful articles and helpful tips on living with Fibromyalgia. Visit the Fibromyalgia Zone today!

.

__,_._,___

Nenhum comentário:

Arquivo do blog