Tecnologia, programação e muito Visual FoxPro.

quinta-feira, 10 de novembro de 2011

Re: ]] XL-mania [[ Extract Text

 

Sudah ketinggalan, kepanjangan lagi...


=ExtendList(B2)

Tetapi mudah-mudahan masih ada gunanya, karena tidak ada pembatasan
kecuali daya muat cell dimana formula ditulis (mudah2-an)

FORMULA hanya 'jalan' jika POLA datanya menuruti aturan seperti pada contoh
misalnya:
GFW123-129, X12-19, 
VW0-0 XFD99-104,i27-33,Ting123-231  


---listing VBA Code / di standard Module ---

Function ExtendList(S As String) As String
   ' purpose: memperluas list
   ' contoh : A1-3,B2-5,C5-7 menjadi A1,A2,A3,B2,B3,B4,B5,C5,C6,C7,
   ' haps, 10 Nov 2011
   '--------------------------------------------------------------
   Dim arS, ArH, K0 As String, K1 As String
   Dim i As Integer, j As Integer, n As Integer
   S = Replace(S, " ", vbNullString)
   arS = Split(Trim(S), ",")
   
   For i = 0 To UBound(arS)
      For j = 1 To Len(arS(i))
         If IsNumeric(Mid(arS(i), j, 1)) Then
            K0 = Left(arS(i), j - 1) & "-" & Right(arS(i), Len(arS(i)) - j + 1)
            Exit For
         End If
      Next j
      ArH = Split(K0, "-")
      For n = CInt(ArH(1)) To CInt(ArH(2))
         K1 = K1 & ArH(0) & n & ","
      Next n
   Next i
   If Len(K1) > 0 Then ExtendList = Left(K1, Len(K1) - 1)
End Function

'-------------------



2011/11/2 henri_hutagalung <henri_htgl@yahoo.co.id>
>
> Dear XL-Mania,
> Mohon bantuannya untuk ekstraksi text pada cell yang seperti pada contoh berikut:
> di cell A1 ada data text dgn isi: A1-3,B1-5,C5-7
> hasilnya jika di ekstrak di cell B1 adalah: A1,A2,A3,B1,B2,B3,B4,B5,C5,C6,C7
> Terima kasih untuk bantuannya.
>
> Rgrds,
> Henri H

__._,_.___
Recent Activity:
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| ayooo... coba cari XL-mania di linkedin.com                       |
| selamat merayakan idul adha!                                      |
+-------------------------------------------------------------------+
| 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.

.

__,_._,___

Nenhum comentário:

Arquivo do blog