Tecnologia, programação e muito Visual FoxPro.

quarta-feira, 26 de outubro de 2011

Re: ]] XL-mania [[ Merge kolom bersyarat

 

' ---vba code ----- ditulis di Module standar

Sub ConditionalMergeCell()
  ' hapsari / 26 Oct 2011 / case XL-mania # 19458
  '-----------------------------------------------
   Dim C As Range, Cval As Variant
   Dim MergeRng As String, StartRng As String
   
   StartRng = Selection(1, 1).Address(0, 0) & ":"
   Cval = Selection(1, 1).Value
   
   Application.DisplayAlerts = False
   For Each C In Selection
      If C(1, 2) = Cval Then
         MergeRng = StartRng & C(1, 2).Address(0, 0)
      Else
         Range(MergeRng).Merge
         StartRng = C(1, 2).Address(0, 0) & ":"
         Cval = C(1, 2).Value
      End If
   Next
   Application.DisplayAlerts = True
End Sub

Cara menggunakan makro:
1. Blok / Select dulu range (baris) yg akan diproses ( dlm ksus ini = E6:BD6 )
2. Jalankan makronya, misal dengan Alt + F8, Pilih Nama Makro--nya, Klik RUN


2011/10/26 Eko Wahyudi <xo_wahyoedy@yahoo.co.id>
>
> Dear Para suhu excel mania….
> Mohon ma'af sebelumnya apabila permasalahan yang saya ajukan ini sudah pernah dibahas sebelumnya.
> Sebelum dan sesudahnya saya ucapkan terimakasih.
> Terimakasih.
> Regards
> Eko

__._,_.___
Recent Activity:
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| ayooo... coba cari XL-mania di linkedin.com                       |
| tanggal 3-4 oktober yahoogroup akan mengalami maintenance.        |
+-------------------------------------------------------------------+
| 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