- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2016-4-10 14:28 ½s¿è
¦^´_ 37# ÂŤÑÄR¦À - Option Explicit
- Private Sub Workbook_Open()
- Dim xRng As Range, First_Aaddres As String, xRng_Name As String
- Application.Calculation = xlCalculationAutomatic
- With Sheets("RTD")
- Set xRng = .Rows(2).Cells.Find("TotalVolume", LookIn:=xlFormulas)
- If Not xRng Is Nothing Then
- First_Aaddres = xRng.Address
- Do
- xRng_Name = Split(xRng.Formula, "'")(1)
- xRng_Name = "TotalVolume" & Split(xRng_Name, ".")(0)
- .Names.Add xRng_Name, xRng ''¦WºÙ©w¸q:©Ò¦³Á`¶qªºDee¤½¦¡ªºÀx¦s®æ
- Set xRng = .Rows(2).Cells.FindNext(xRng)
- Loop Until xRng.Address = First_Aaddres
- End If
- End With
- End Sub
½Æ»s¥N½X «ºâ¨Æ¥ó¸Õ¸Õ¬Ý- Option Explicit
- Private Sub Worksheet_Calculate()
- Dim Rng As Range, E As Variant
- On Error Resume Next ' Àɮ׶}±Ò®É DEE¶Ç¦^¿ù»~È
- Set Rng = UsedRange.Cells.SpecialCells(xlCellTypeFormulas, xlErrors)
- If Not Rng Is Nothing Then Exit Sub
- On Error GoTo 0 '¶}½L¤£¦A³B²zµ{¦¡½Xªº¿ù»~
- If Time < #9:00:00 AM# Or Time > #1:31:00 PM# Then Exit Sub '«DÀç·~®É¶¡
- For Each E In Me.Names
- If E.Name Like "*TotalVolume*" Then 'Á`¶qªº¦WºÙ
- If Range(E.Name) > 0 Then
- With Cells(Rows.Count, Range(E.Name).Column).End(xlUp) ''Á`¶q¦WºÙ©Ò¦bªº³Ì©³¦C©¹¤W¨ì¦³¸ê®ÆªºÀx¦s®æ
- If .Row = 2 Or .Row > 2 And .Value <> Range(E.Name).Value Then
- .Offset(1).Cells(1, -2).Resize(, 4) = Range(E.Name).Cells(, -2).Resize(, 4).Value
- End If
- End With
- End If
- End If
- Next
- End Sub
½Æ»s¥N½X |
|