ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ByVal a As Range~¦¹Ãþ»yªkªº¥Îªk¡A¤£¤Ó²M·¡

[µo°Ý] ByVal a As Range~¦¹Ãþ»yªkªº¥Îªk¡A¤£¤Ó²M·¡

¥»©«³Ì«á¥Ñ sayloveme ©ó 2011-12-30 14:21 ½s¿è

Public Function FmdFatotal(ByVal a As Range, ByVal b As Range, ByVal c As Integer, ByVal pollutant As String) As Double
   Dim IRptData As Integer
   
   IRptData = 6
   FmdSTotal = 0
   
    Do Until Left(Trim(Sheets("¸ê®Æ").Cells(IRptData, 4).Value), 1) = "¥»"
        If Sheets("¸ê®Æ").Cells(IRptData, 21) > c Then
            If Trim(Sheets("¸ê®Æ").Cells(IRptData, 9).Value) = pollutant Then
                FmdFatotal = FmdFatotal + Sheets("¸ê®Æ").Cells(IRptData, 20)
            End If
        End If
        IRptData = IRptData + 1
    Loop
End Function

--------------------------§Ú¬O¤À¹j½u----------------------
Ãö©ó³o¬q»yªk¡A·Q½Ð±Ðª©¤Wªº°ª¤â¡A¬O§_¯à°÷À°§Ú¸ÑÄÀ¤@¤U¡A§ä´M¤F¦U¤jºô¯¸¡AIRptData ¸òDo Until Left(Trim(Sheets("¸ê®Æ").Cells(IRptData, 4).Value), 1)¡A³o¬q»yªk¡A§¹¥þ¬Ý¤£À´~ÁٽЯ«¤H¤j¤j½ç±Ð¡A·P¿E¤£¶i~!!ÁÂÁÂ

IRptData -->¦Û­qªº¾ã¼ÆÅܼÆ
µ{¦¡²Ä¤G¦æ¤v»¡©ú¤F (Dim IRptData As Integer)
Do ..... Loop --> ­«Âаõ¦æ .....  ³¯­z¦¡(°j°é)
¥H¤WÀ³¬Ovba°ò¥»¥\,¦bexcel ªºvba½s½r¾¹¤¤ªº»¡©úÀɤ¤³£¦³½d¨Ò»¡©ú
µ½¥Îvba½s½r¾¹¤¤ªº»¡©úÀÉ,¥iÅý±zªºvba¥\¤O¤j¼W

TOP

¦^´_ 2# kobo


  ¤j¤j±z¦n¡A¨º¹³¬ODim IRptData As Integer¡A¤w¸g©w¸q¬°¾ã¼Æ¤F¡A¬°¦ó©³¤UIRptData = 6¡BFmdSTotal = 0 ÁÙ­n¶i¦æ³o¼Ëªº³]©w¡A¨º­Ó6¬O§_¦³ÂI¦h¾l©O?¡A
ÁÙ¬O»¡¥¦¦³¬Æ»ò¯S©w§t¸q©O!? ÁÂÁ¡A¥t¥~ Until Left (Trim(Sheets("¼f¬d¸ê®Æ").Cells(IRptData, 4).Value), 1)¡A³o¦ê»yªk·í¤¤¡A
¤ñ¸û¤£À´ªº¬OUntil Left (Trim(¸ê®Æ).Cells(¦Û©w¸q,4).Value),1)¡A³o¼Ëªº°µªk¡A·|¦³¬Æ»ò¼Ëªº®ÄªG©O!?¤w¥Î²ÊÅé¼Ð¥Ü¡A«D±`ÁÂÁ±zªº¦^µª¡C

TOP

¦^´_ 2# kobo

·PÁ¤j¤j¡A¨Ì·Ó¤j¤jµ¹ªº¤è¦V¥J²ÓÂsÄý¹L¤@¹M¡A¤ß¸Ì¤j·§¦³­Ó¤è¦V¡A¦³­Ó³¡¥÷·Q¦A½Ð±Ð¤@¤U¡A
IRptData = 6
   FmdSTotal = 0
   
    Do Until Left(Trim(Sheets("¼f¬d¸ê®Æ").Cells(IRptData, 4).Value), 1) ="¥»"

¨ä¤¤Cells(IRptData, 4)³o­Ó¬O§_¯à°÷¬Ý¦¨Cells(6, 4)¡A¥t¥~³Ì«á="¥»"³o­Ó¦³¬Æ»ò§@¥Î¹À!? ÁÂÁ¤j¤j

TOP

¥»©«³Ì«á¥Ñ hugh0620 ©ó 2011-12-30 15:15 ½s¿è

¦^´_ 4# sayloveme


    ¦]¬°¥¦¬O¼g °j°é DO... LOOP
    ·í§P©w¸ê®Æ="¥»"®É~ ´NÂ÷¶}¦^°é  
    (°j°é»Ý­n¦³¤@­Ó°±¤îªº±ø¥ó~ Do until ±ø¥ó¦¡ =>²Å¦X³o­Ó±ø¥ó´NÂ÷¶}°j°é~
     ¹³§A©ñ¤W¥hªºµ{¦¡½X«Ü¥i¯à·|²£¥Í´`Àô°j°é¤¤~  ¦]¬°¦³¥i¯à¸ê®Æ·|¦³"¥»"³o­Ó¸ê®Æ)
    ¶i¦æ¤U¤@¬qµ{¦¡½X©ÎÂ÷¶}µ{¦¡
¾Ç²ß¤~¯à´£¤É¦Û¤v

TOP

¥»©«³Ì«á¥Ñ kobo ©ó 2011-12-30 15:10 ½s¿è

Dim IRptData As Integer '   «Å§iIRptData ¬°¾ã¼Æ
   IRptData = 6                '  IRptData ªì©l­È¬° 6
   ..........
   ¡õ¡õ¡õ¡õ ­«Âаõ¦æ°j°é,ª½¨ì Left(Trim.....), 1) = "¥»" ¦¨¥ß¬°¤î¡õ¡õ¡õ¡õ(±ø¥ó¦¨¥ß¸õ¥X°j°é)
    Do Until Left(Trim(Sheets("¸ê®Æ").Cells(IRptData, 4).Value), 1) = "¥»"  (IRptData²Ä¤@¦¸¬O6)
      .............
        IRptData = IRptData + 1   '¨C°õ¦æ¤@¦¸ IRptData ´N¥[ 1   
    Loop

TOP

Do   While  ±ø¥ó  (±ø¥ó¦¨¥ß °õ¦æ°j°é)  /  Until  ±ø¥ó  (±ø¥ó¦¨¥ß ¤£°õ¦æ°j°é)  ***¥i¸m©ó Do
     if  ±ø¥ó=True Then   Exit Do                          '*** ¤]¥i¤¤¶¡³]¥ß±ø¥ó Â÷¶}°j°é
Loop    While  ±ø¥ó  (±ø¥ó¦¨¥ß °õ¦æ°j°é)  /  Until  ±ø¥ó  (±ø¥ó¦¨¥ß ¤£°õ¦æ°j°é)  ***¤]¥i¸m©ó Loop

TOP

¥»©«³Ì«á¥Ñ sayloveme ©ó 2011-12-30 17:24 ½s¿è

¦^´_ 5#¡B6#¡B7#


·PÁ¤j¤j­Ìªº¦^ÂСA¤p§Ì¥t¥~¦³­Ó§xÂZ¡A«Ø¥ß¦nªº¥¨¶°¡AµLªk¥¿½T«Ø¥ßÀɮצW¡A¨Ò¦p§Ú99¦~~¥¿±`¥X¨Ó·|¬O099X¡A¦ý¦pªG§Ú¿é¤J100¦~¡A¥L¶]¥X¨ÓªºÀɮצW«o¬O010¡A
½Ð°Ý¦³¬Æ»ò¤èªk¥i¥H¸Ñ¨M¹À!? ¥Ø«e¥N½X±¡ªp¦p¤U¡G

YS = YS_Y & " ¦~ " & YS_S
  WestYS1 = CLng(1910 + CLng(YS_Y))
  WestYS2 = CLng(1912 + CLng(YS_Y))
  
  Filename = UCase(FacNo.Text) & "_" & GetSsn(YS)
   If CLng(YS_Y) > 95 Then '¥[¤J96¦~·sªí³æ
    lsExcelModel = lsExcelFilePath & "96¦~¸Õºâªí.xls"
   Else
    lsExcelModel = lsExcelFilePath & "¸Õºâªí.xls"
   End If
  Workbooks.Open Filename:=lsExcelModel
  Sheets.Add After:=Worksheets(Worksheets.Count)
  Sheets(ActiveCell.Worksheet.Name).Select
  Sheets(ActiveCell.Worksheet.Name).Name = "¶×¤J"
      Columns("A:AZ").Select
      Selection.NumberFormatLocal = "@"
  ActiveWorkbook.SaveAs Filename:=lsExcelFilePath & "«ØÀɸê®Æ\" & Filename & ".xls" '¦sÀɸô®|
'----------------------------------------------------¨ú¥X¸ê®Æ
  EmptyRowIndex = GetEmptyRowIndex("¶×¤J")
  Cells(EmptyRowIndex, 3).Value = "#" & "P_Factory" & "#"
  SQLStr = "SELECT P_Factory.* FROM P_Factory WHERE (((P_Factory.ºÞ¨î½s¸¹)='" & FacNo & "'))"
  Call GetDataFromDB(lsDBFilePathName, SQLStr, EmptyRowIndex + 1, "Yes")
-----------------§Ú¬O¤À¹j½u---------------------------

½Ð°Ý¤j¤j¥H¤W¦³¯Ê¬Æ»ò¸ê®Æ¶Ü!? ÁÙ¬O¦³¬Æ»ò»Ý­n­×§ïªº¹À!? ¥ýÁÂÁ¦U¦ì¤j¤jªº¤£§[§iª¾¡A¸U¤À·PÁ¡C

TOP

¦^´_ 8# sayloveme

½Ð°Ýª©¤Wªº°ª¤â¡A8¼Óªº°ÝÃD¸Ó¦p¦ó¸Ñ¨M©O~«ô°U¦U¦ì¤j¤j¤F

TOP

¦^´_ 9# sayloveme
¥u¬O¤ù¬qªºµ{¦¡½X!!, ½Ö¯à¸Ñµª?

TOP

        ÀR«ä¦Û¦b : ¤f»¡¤@¥y¦n¸Ü¡A¦p¤f¥X½¬ªá¡F¤f»¡¤@¥yÃa¸Ü¦p¤f¦R¬r³D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD