tokputih
CG Top Poster Club

- Messages
- 27,694
- Joined
- Apr 24, 2008
- Messages
- 27,694
- Reaction score
- 1,026
- Points
- 206
tok
hasil carian google formula ni memerlukan vba macro.
tapi akan ada error debug. debug bila highlight entire column, kalau highlight cell berkaitan tidak akan debug.
(asalkan boleh guna kira ok laa tuu)..
mula mula highlight column / cell tersebut, pastu run macro.
Public Sub SortContents()
Dim oCell As Range
Dim I As Integer, J As Integer, iLen As Integer
Dim strChr() As String, strWk As String
For Each oCell In Selection
strWk = oCell.Value
iLen = Len(strWk)
ReDim strChr(1 To iLen)
For I = 1 To iLen
strChr(I) = Left(strWk, 1)
strWk = Right(strWk, Len(strWk) - 1)
Next I
For I = 1 To iLen - 1
For J = I + 1 To iLen
If strChr(J) < strChr(I) Then
strWk = strChr(I)
strChr(I) = strChr(J)
strChr(J) = strWk
End If
Next J
Next I
strWk = ""
For I = 1 To iLen
strWk = strWk & strChr(I)
Next I
oCell.Value = strWk
Next oCell
End Sub
ok tok try dulu
maaf memang nak buat dalam cell bukan column