Tecnologia, programação e muito Visual FoxPro.

quarta-feira, 2 de junho de 2010

Re: ]] XL-mania [[ iterasi ceceng atau cepeceng

 

Sepertinya formula array penghitung baris Value yang membuat lama.
Untuk iterasinya (susun nilai acak antara nilai baris 1 dan 2 per kolom) bisa disederhanakan menjadi :

Puvlic Sub SusunRandom()
    Dim rng As Range
    Dim lYear As Long
    Dim lIterasi As Long
    Dim lCalc As Long
    Dim dblTime As Double
   
    dblTime = CDbl(Now)
    lCalc = Application.Calculation
    Application.Calculation = xlCalculationManual
    Application.ScreenUpdating = False
    lIterasi = Range("b3")
    If lIterasi > 999 Then
        MsgBox "Mungkin agak lama. Harap bersabar."
    End If
    Range("b6").CurrentRegion.Offset(0, 1).Resize(columnsize:=27 * 5).ClearContents
    lYear = 0
    Do While lYear < 5      'angka 5 adalah tahun
        Set rng = Range("b6").Offset(0, lYear * 27).Resize(lIterasi, 26)
        With rng
            .FormulaR1C1 = "=INT(RAND()*(R2C-R1C+1)+R1C)"
            .Calculate
            .Copy
            .PasteSpecial xlPasteValues
        End With
        lYear = lYear + 1
    Loop
    ActiveSheet.Calculate
    Application.Calculation = lCalc
    Application.ScreenUpdating = True
   
    'hitung waktu dalam detik (tidak presisi)
    MsgBox "Selesai." & vbCrLf & Format$(CDbl(Now) - dblTime, "hh:mm:ss")
End Sub

2010/6/1 agusman wizaldy <wizaldy@yahoo.com>
 

para sesepuh ane mohon bantuan nech..

ane buat iterasi ngegunain vba dan masing-masing kolom di cari nilai
yang paling sering muncul.(file terlampir),

masalah muncul pada saat iterasi di atas 1000 ...apalagi klo 10000
..proses jadi lama..ane curiga VBA yang ane buat salah..(maklom lagi
belajar..)

Adakah di antara para sesepuh yang bisa ngebantu ane ..plzzz

Thanx in advance

wizaldy


__._,_.___
Recent Activity:
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| selamat hari raya waisak untuk merayakan... selamat long weekend. |
| http://www.facebook.com/group.php?gid=37671048001&ref=mf          |
+-------------------------------------------------------------------+
| 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.


Get great advice about dogs and cats. Visit the Dog & Cat Answers Center.


Hobbies & Activities Zone: Find others who share your passions! Explore new interests.

.

__,_._,___

Nenhum comentário:

Arquivo do blog