yang bunyi function dalam sebuah general module VBA-nya berbunyi :
[letakkan dalam sebuah general module di VBE]'re-write VB : 201305
Public Function SubsMidChar(sTeks As String, Optional sChar As String = "*") As String
Dim vKata As Variant, sHasil As String
For Each vKata In Split(sTeks, " ")
If Len(vKata) > 2 Then
sHasil = sHasil & Left(vKata, 1) & String(Len(vKata) - 2, sChar) & Right(vKata, 1) & " "
Else
sHasil = sHasil & vKata & " "
End If
Next vKata
SubsMidChar = Trim(sHasil)
End Function
Public Function SubsMidChar(sTeks As String, Optional sChar As String = "*") As String
Dim vKata As Variant, sHasil As String
For Each vKata In Split(sTeks, " ")
If Len(vKata) > 2 Then
sHasil = sHasil & Left(vKata, 1) & String(Len(vKata) - 2, sChar) & Right(vKata, 1) & " "
Else
sHasil = sHasil & vKata & " "
End If
Next vKata
SubsMidChar = Trim(sHasil)
End Function
Cara pakai dalam worksheet :
=SubsMidChar( teks , [karakter_pengganti] )
Contoh untuk data di A1 berbunyi : 'Contoh dari ku'
Bunyi Formula Hasilnya
=SubsMidChar( A1 ) C****h d**i ku
=SubsMidChar( A1 , "#" ) C####h d##i ku
=SubsMidChar( A1 , "@?$" ) C@@@@h d@@i ku
Wassalam,
Kid.
2014-07-23 13:15 GMT+10:00 Galuh Sukmana galuh.sukmana@gmail.com [XL-mania] <XL-mania@yahoogroups.com>:
Dear All Excelers,Saya ingin mengganti beberapa char dicell bersyarat menggunakan replace atau substitute, tetapi saya kesulitan membuatnya karena masing2 cell tidak sama jumlah characternyaCth:Budi Indah Lalu = B**i I***h L**uWindarini Suratmi = W*******i S*****iMejikuhibiniu = M***********uBantex Bagus Putih = B****x B***s P***h
Mohon bantuannya utk bisa memberikan pencerahannya. Atas bantuannya diucapkan terima kasihRegards,Galuh
__._,_.___
Posted by: "Mr. Kid" <mr.nmkid@gmail.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
Yahoo Groups
Instantly Explore All Attachments Within Each Group Conversation
You can now explore files, preview and download photos directly within each conversation.
:: XL-mania ::::::::::::::::::::
Momods sekarang jualan tas di www.flirtypoodle.com ha ha ha....
:: ------------- ::::::::::::::::::::
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.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
Momods sekarang jualan tas di www.flirtypoodle.com ha ha ha....
:: ------------- ::::::::::::::::::::
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.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
.
__,_._,___
Nenhum comentário:
Postar um comentário