Tecnologia, programação e muito Visual FoxPro.

segunda-feira, 19 de outubro de 2009

Re: ]] XL-mania [[ Menghitung volume dalam rentang waktu

 

Omm....kalo di bikina make VBA kodingannya sbb :
' --------------------------------------------------------------------
' Nama Modul :Momod.mod
' Kegunaan : Membagi Waktu berdarakan interval waktu
' Created By : puthut_vai@yahoo.com @ 21 Okt 2009
' --------------------------------------------------------------------

Option Explicit
 
Dim wShitMaster As Worksheet
Dim x As Variant
Dim BarisTerakhir As Long
Dim r As Long
Dim txtValidasiBawah, txtValidasiAtas, txtValidasi As String
Dim vCountHasilAkhir As Long
Dim wShitHasil As Worksheet
Dim i As Long

   
Sub EnakOOm()
     
Application.ScreenUpdating = False
       
Set wShitMaster = Worksheets("MasSalah") ' Set Master Data pada sheet 10
BarisTerakhir = wShitMaster.Range("B" & Rows.Count).End(xlUp).Row ' Nilai Looping

Set wShitHasil = Worksheets.Add(after:=Worksheets(Sheets.Count))
wShitHasil.Activate
   
vCountHasilAkhir = 3
x = 1
r = 3
txtValidasiBawah = Format(Time, "00:00")
txtValidasiAtas = Format(Time, "00:30")
'   Loop sampai dengan Cell kosong
Do While wShitMaster.Cells(r, 2) <> ""
    For i = 3 To BarisTerakhir
        If TimeValue(Format(wShitMaster.Cells(i, 2), "HH:MM")) >= txtValidasiBawah Then
            If TimeValue(Format(wShitMaster.Cells(i, 2), "HH:MM")) <= TimeValue(txtValidasiAtas) Then
                wShitHasil.Cells(i, 1) = Format(wShitMaster.Cells(i, 2), "HH:MM:SS")
                wShitHasil.Cells(i, 2) = wShitMaster.Cells(i, 4)
                wShitHasil.Cells(i, 3) = txtValidasiBawah & "-" & txtValidasiAtas
                vCountHasilAkhir = vCountHasilAkhir + 1
            End If
        End If
    Next i
      
    txtValidasiBawah = TimeValue(txtValidasiBawah) + TimeValue("0:30")
    txtValidasiAtas = TimeValue(txtValidasiAtas) + TimeValue("0:30")
   
    If x <= 46 Then
        wShitHasil.Activate
        wShitHasil.Cells(x, 7) = txtValidasiBawah & "-" & txtValidasiAtas
        x = x + 1
    End If

r = r + 1
Loop
   
For x = 1 To 46
    wShitHasil.Cells(x, 8) = PenjumlahanWaktu(wShitHasil.Cells(x, 7))
Next x


wShitHasil.Columns("A:G").AutoFit ' Autofit Hasil Tabel
Application.ScreenUpdating = True
End Sub

' --------------------------------------------------------------------
' Nama Fungsi :PenjumlahanWaktu
' Kegunaan : Menjumlah Nilai pada interval waktu yang telah ditentukan
' Created By : puthut_vai@yahoo.com @ 21 Okt 2009
' --------------------------------------------------------------------

Public Function PenjumlahanWaktu(Intervaljam As String) As Long
Dim i As Long
Dim ValidasiInterval As String
Dim TmpValue As Long
Set wShitHasil = ActiveSheet

wShitHasil.Activate

BarisTerakhir = wShitMaster.Range("B" & Rows.Count).End(xlUp).Row ' Nilai Looping

' Nilai Default
PenjumlahanWaktu = 0

i = 3
    For i = 3 To BarisTerakhir
        ValidasiInterval = Format(wShitHasil.Cells(i, 3), "HH:MM:SS")
        If Intervaljam = ValidasiInterval Then
          
            TmpValue = wShitHasil.Cells.Cells(i, 2)
            PenjumlahanWaktu = TmpValue + PenjumlahanWaktu
               
        End If
       
    Next i
End Function

File Terlampir oomm.....Jangan Lupa Srikiti Makronyaaa
- ^ Puthut Wibowo ^ - || puthut_vai@yahoo.com


































--- On Mon, 10/19/09, oyi kresnamurti <kresnamurti@yahoo.co.id> wrote:

From: oyi kresnamurti <kresnamurti@yahoo.co.id>
Subject: ]] XL-mania [[ Menghitung volume dalam rentang waktu
To: XL-mania@yahoogroups.com
Date: Monday, October 19, 2009, 3:54 PM

 

:)
selamat sore xlmania,
misalnya saya mempunyai data rentang waktu dari pukul 9 pagi sampai 4
sore, namun saya ingin mengelompokkan jumlah volumenya per 30 menit,
adakah satu rumus di excel yang bisa menyelesaikannya secara langsung?
mohon bantuannya, terima kasih sebelumnya.

terlampir file yang hendak ditanyakan.

--
wassalam,
oyi kresnamurti
____________ _________ _________ _
http://kaffah4829. wordpress. com


__._,_.___
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| Moderasi akan lambat minggu ini, momods pergi ke tempat jauh      |
| 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              |
+-------------------------------------------------------------------+
Recent Activity
Visit Your Group
Give Back

Yahoo! for Good

Get inspired

by a good cause.

Y! Toolbar

Get it Free!

easy 1-click access

to your groups.

Yahoo! Groups

Start a group

in 3 easy steps.

Connect with others.

.

__,_._,___

Nenhum comentário:

Arquivo do blog