Tecnologia, programação e muito Visual FoxPro.

domingo, 11 de julho de 2010

Re: ]] XL-mania [[ This operation requires the merge cells to be identically sized.

 

Jika tujuannya hanya Mencari Ranking, sebenarnya kita dapat menggunakan fungsi RANK.

Tetapi Jika tetap dikehendaki Sorting, dan sortingnya harus dengan TOMBOL serta tidak ingin menormalkan tabel yg mengandung merged-cells tsb, .....
maka salah satu trick makronya seperti ini

'--------------------------
Sub Sorting_Sortingan()

'----------------------------------
' siti Vi / 9 Juli 2010 /
' special sorting on table with mergedcells
'----------------------------------

   Dim vRng As Range, ArrD()
   Dim n As Long, i As Long, c As Integer

   '-- menentukan range yg mo di-SORT
   Set vRng = Range("A3").CurrentRegion
   Set vRng = vRng.Offset(2, 0)
   n = 0
  
   '--mengambil data dari range u/ ditampung di
   ' array 2 dimensi  (6 x n  elements)
    For i = 1 To vRng.Rows.Count - 2
      If Not IsEmpty((vRng(i, 1))) Then
         n = n + 1
         ReDim Preserve ArrD(1 To 6, 1 To n)
         For c = 1 To 5
            ArrD(c, n) = vRng(i, c)
         Next c
         ArrD(6, n) = vRng(i + 1, 5)
      End If
   Next i
   n = 0
  
   '--sorting terhadap elements array; dibantu UDF
   ArrD = DesceBubbleSort(ArrD)
  
   '-- menuliskan data yg telah sorted ke tabel
    For i = 1 To vRng.Rows.Count - 1
      If Not IsEmpty((vRng(i, 1))) Then
         n = n + 1
         For c = 1 To 5
            vRng(i, c) = ArrD(c, n)
         Next c
         vRng(i + 1, 5) = ArrD(6, n)
      End If
   Next i
  
End Sub
'----------------------------

Makro ini tentu tidak dengan sendirinya dapat mensort TABEL LAIN
yg struktur-nya tidak persis sama dengan tabel yg diajukan sbg contoh..



2010/7/6 DHAY DAY <dhayku@gmail.com>
Langsung aja yach...
Spesial Sorting mbak siti_vi gagal  mensortir tabel.. hanya bisa
mensortir satu kolom saja..
Pakar XL-mania yang lain ada solusi nggak???
Contoh tabel terlampir..
thankz..
DAY

__._,_.___
Recent Activity:
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| jangan lupa sebelum bertanya, cek dulu www.XL-mania.com dan       |
| http://tech.groups.yahoo.com/group/XL-mania/messages              |
| 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.


Get great advice about dogs and cats. Visit the Dog & Cat Answers Center.


Hobbies & Activities Zone: Find others who share your passions! Explore new interests.

.

__,_._,___

Nenhum comentário:

Arquivo do blog