maaf; sekali lagi masih mengenai "Diurut"
kalau harus pakai makro; VBA-coding-nya kan tidak harus yg mengerikan
cukup yg ringkas-ringas saja...
'-------------------
Private Sub CtvBubbleSort(D, Optional ASortOrder As Boolean = True)
' --ctv // the Real Sorting applied on an array--
Dim i As Long, j As Long, n As Long, k As Long
Dim X, Y, tTip, LogicTest As Boolean
n = UBound(D)
For i = 1 To n - 1
For k = n To (i + 1) Step -1
j = k - 1
X = CInt(Mid(D(k), 12, Len(D(k)) - 11))
Y = CInt(Mid(D(j), 12, Len(D(j)) - 11))
LogicTest = IIf(ASortOrder, X < Y, X > Y)
If LogicTest Then
tTip = D(k): D(k) = D(j): D(j) = tTip
End If
Next k
Next i
End Sub
Dim i As Long, j As Long, n As Long, k As Long
Dim X, Y, tTip, LogicTest As Boolean
n = UBound(D)
For i = 1 To n - 1
For k = n To (i + 1) Step -1
j = k - 1
X = CInt(Mid(D(k)
Y = CInt(Mid(D(j)
LogicTest = IIf(ASortOrder, X < Y, X > Y)
If LogicTest Then
tTip = D(k): D(k) = D(j): D(j) = tTip
End If
Next k
Next i
End Sub
'----------------
Sub Special_Sort()
' --ctv // 28 okt 09 --
' --ctv // 28 okt 09 --
Dim dRange As Range, dArr(), i As Long, n As Long
Set dRange = Application.InputBox(Prompt:="Tunjuk Range yg akan sort", _
Title:="Special Sorting", Default:=Selection.Address, Type:=8)
n = dRange.Cells.Count: ReDim dArr(1 To n)
For i = 1 To n: dArr(i) = dRange(i): Next
Call CtvBubbleSort(dArr, True)
For i = 1 To n: dRange(i, 3) = dArr(i): Next i
Call CtvBubbleSort(dArr, False)
For i = 1 To n: dRange(i, 5) = dArr(i): Next i
End Sub
Set dRange = Application.
Title:="Special Sorting", Default:=Selection.
n = dRange.Cells.
For i = 1 To n: dArr(i) = dRange(i): Next
Call CtvBubbleSort(
For i = 1 To n: dRange(i, 3) = dArr(i): Next i
Call CtvBubbleSort(
For i = 1 To n: dRange(i, 5) = dArr(i): Next i
End Sub
'-----------------
----- Original Message -----From: siti ViSent: Wednesday, October 28, 2009 07:45PMSubject: Re: ]] XL-mania [[ Re: DiurutTerima kasih pak J4jaNk....Kalau gitu...misal dikehendaki sorting dengan ARRAY formulasalah satu caranya spt inisort - ascending:=INDEX(B3:B22,RIGHT(TEXT(SMALL(--SUBSTITUTE( LEFT(B3:B22, 11)& RIGHT("000"&MID(B3:B22,12,3),3),"." ,"")+ROW( 1:20)/100, ROW(1:20) ),"0.000" ),3)/10) sort - descending(SMALL diganti LARGE )rumus tsb sudah mengantisipasi jika data : 11 karakter pertamatidak harus seragam seperti contoh yg ada=======----- Original Message -----
From: { J 4 j a N k }
To: XL-mania@yahoogroups.com
Sent: Wednesday, October 28, 2009 02:30PM
Subject: ]] XL-mania [[ Re: Diurut
Mohon maaf hasil yang diinginkan adalah :
192.168.11.1
192.168.11.12
192.168.11.15
192.168.11.100
192.168.11.110
192.168.11.139
192.168.11.141
192.168.11.144
192.168.11.145
192.168.11.146
192.168.11.148
192.168.11.149
192.168.11.150
192.168.11.151
192.168.11.152
192.168.11.153
192.168.11.154
192.168.11.155
192.168.11.156
192.168.11.157
dan sebaliknya
__._,_.___
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| Moderasi akan lambat minggu ini, momods pergi ke tempat jauh |
| 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 |
+-------------------------------------------------------------------+
| Moderasi akan lambat minggu ini, momods pergi ke tempat jauh |
| 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
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
.
__,_._,___
Nenhum comentário:
Postar um comentário