Tecnologia, programação e muito Visual FoxPro.

quinta-feira, 25 de agosto de 2011

Re: ]] XL-mania [[ Loop yg berulang

 

Dear ND,

Prosedur berikut tanpa proses loop.
Public Sub PasangSum()
    Dim lRow As Long
    Dim rngData As Range
   
    'tentukan jumlah baris data dan set area kerja
    lRow = Evaluate("=max(a:a)") * 1.2 + 1
    Set rngData = Range("a1").Offset(1, 2).Resize(lRow, 1)
   
    With rngData
        'pasang formula
        .Formula = "=Sum(a2:b2)"
       
        'bersihkan baris kosong (dibantu autofilter)
        ActiveSheet.AutoFilterMode = False
        .CurrentRegion.AutoFilter 1, "="
        .SpecialCells(xlCellTypeVisible).ClearContents
        ActiveSheet.AutoFilterMode = False
    End With
End Sub

Regards.
Kid.

2011/8/25 Novan Dwiascahyo <novan.dwiascahyo@leighton.co.id>
 

Dear XL-mania,

 

Mohon bantuannya memperbaiki formula macro yg menggunakan Do.. Loop, sehingga proses penghitungan data dapat berlangsung kontinyu hanya dengan sekali running macro dan baru akan berhenti setelah menghitung data yg paling bawah.

 

Perintah yg saya gunakan adalah sbb:

 

Sub sum()

' sum

' penjumlahan biasa

    Do

    If IsEmpty(ActiveCell) Then

        If IsEmpty(ActiveCell.Offset(0, -1)) And IsEmpty(ActiveCell.Offset(0, -2)) Then

            ActiveCell.Value = ""

        Else

            ActiveCell.FormulaR1C1 = "=sum(RC[-1],RC[-2])"

        End If

    End If

    ActiveCell.Offset(1, 0).Select

    Loop Until IsEmpty(ActiveCell.Offset(-1, -1))

End Sub

 

Kasus lengkapnya mohon disimak file terlampir. Thanks berat.

 

Note: Ini postingan ke-2 (dgn sedikit edit) karena postingan yg pertama sepertinya tidak sampai dengan slamet.

 

Salam,

ND

 


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________


__._,_.___
Recent Activity:
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| jangan lupa sebelum libur:                                        |
| - add XL-mania di linkedin www.linkedin.com/company/xl-mania      |
| - pesan buku "mengapa boss benci chart anda"  :D :D :D            |
+-------------------------------------------------------------------+
| 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
A bad score is 596. A good idea is checking yours at freecreditscore.com.
.

__,_._,___

Nenhum comentário:

Arquivo do blog