- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¥»©«³Ì«á¥Ñ c_c_lai ©ó 2013-8-5 10:38 ½s¿è
¦^´_ 49# slip
¤µ¦§Ú¹ê»Ú¶]¤F¤@¤U§Aªºµ{¦¡ (¦³ÂI»y¯f)¡A§Ú²¤·L×¥¿¤F¤@¨Ç»yªk¡A¨Ã¥[¤W Rng Åܼƫŧi¡C
¤j¬ùÆ[¹î¤F¤@Ó¦h¤p®É¡A¦]µLªk¶Ç¤W¹Ï¥Ü (ºô¶¹Ï¤ù¡Bªþ¥ó§¡µLªk¥¿±`¨Ï¥Î) Åý§A¤À¨É¡A
¬Gª½±µ¶K¤Wµ{¦¡½X¡A§A¦A¦Û¦æ¶K¤J§Aªº Module1 ¤º¡A¤º®e¦p¤U¡G
P.S. §A³]©wªº¤¬íÄÁ¼g¤J¤@µ§¸ê®Æ¡A¦n¹³¬O¦b»°¥«¶°¦üªº¡A¬Ý±o§Ú¦Ñ¤H®a²´µoÁA¶Ãªº¡A
§Ú¥ý±N¥¦§ï¦¨¤@¤ÀÄÁ°õ¦æ¤@¦¸¡A§A¤]¥i¥H¨Ï¥Î 20 ¬í¤@µ§°µ¬°°Ñ¦Ò (¸û«ÈÆ[)¡C- Sub GetDDE()
- Dim T As Date, Sh(1 To 2), i As Long, Rng As Range
-
- T = Now ' ¨ú±o²{¦b®É¶¡
- Set Sh(1) = ThisWorkbook.Sheets(1)
- Set Sh(2) = ThisWorkbook.Sheets(2)
-
- If Not IsError(Sh(1).[B2]) Then
- Set Rng = Sh(2).[A65536].End(xlUp).Offset(1) ' ª«¥ó
- Rng.Resize(, 7) = Sh(1).[A2:G2].Value ' ±N¤u§@ªí1ªºDDE¸ê®Æ¼g¤J¤u§@ªí2
- With Sh(2)
- i = Rng.Row
-
- Rng.Offset(, 7) = Rng.Offset(, 3) - Rng.Offset(, 2) ' Hø󪺤½¦¡=>Døó-Cøó
- Rng.Offset(, 8) = Rng.Offset(, 7) - Rng.Offset(, 7).Offset(-1) ' I413=H413-H412......¼Æ¦C2
- Rng.Offset(, 9) = Rng.Offset(, 4) ' Jø󪺤½¦¡=Eøó
- ' xMax = Application.Max(.[I:J]) ' ³Ì¤jÈ
- ' xMin = Application.Min(.[I:J]) ' ³Ì¤pÈ
- ' ** .Parent.ChartObjects(1): ª«¥ó (¤u§@ªíªº²Ä1ӹϪí) *****
- With .ChartObjects(1).Chart
- .SeriesCollection(1).Values = .Parent.Parent.Range("I2:I" & i) ' «ü©w¼Æ¦C¸ê®Æªº½d³ò
- .SeriesCollection(1).ChartType = 52 ' «ü©w¼Æ¦C¹ÏªíÃþ«¬
- .SeriesCollection(2).Values = .Parent.Parent.Range("J2:J" & i)
- .SeriesCollection(2).ChartType = 65
- If .SeriesCollection(2).AxisGroup <> xlSecondary Then .SeriesCollection(2).AxisGroup = xlSecondary
- ' ¼Æ¦C¤£¦b²Ä 2 Y®y¼Ð¶b(°Æ®y¼Ð): ¼Æ¦C«ü©w¨ì²Ä 2 Y®y¼Ð¶b(°Æ®y¼Ð) ' .AxisGroup = 2 -> °Æ®y¼Ð
-
- .Parent.Top = .Parent.Parent.Range("L" & IIf(i <= 39, 1, i - 38)).Top ' «ü©w¹Ïªí³»ºÝªº¦ì¸m
- With .Axes(xlValue) ' Y (¥D) ®y¼Ð¶b
- .MinimumScale = Application.Min(.Parent.Parent.Parent.[I:I]) ' ³Ì¤pÈ
- .MaximumScale = Application.Max(.Parent.Parent.Parent.[I:I]) ' ³Ì¤jÈ
- .MajorUnitIsAuto = True ' ¥Dn¨è«×¶¡¶Z=¦Û°Ê³]©w
- .MinorUnitIsAuto = True ' ¦¸n¨è«×¶¡¶Z=¦Û°Ê³]©w
- .Crosses = xlAutomatic ' ®y¼Ð¶b»P¨ä¥L®y¼Ð¶b¥æ¤eªºÂI=¦Û°Ê³]©w
- .ScaleType = xlLinear ' ¼ÆÈ®y¼Ð¶bªº¨è«×Ãþ«¬=xlLinear
- End With
-
- With .Axes(xlValue, xlSecondary) ' Y (°Æ) ®y¼Ð¶b
- .MinimumScale = Application.Min(.Parent.Parent.Parent.[J:J]) ' ³Ì¤pÈ
- .MaximumScale = Application.Max(.Parent.Parent.Parent.[J:J]) ' ³Ì¤jÈ
- .MaximumScaleIsAuto = True
- .MajorUnitIsAuto = True
- .MinorUnitIsAuto = True
- .Crosses = xlAutomatic
- .ScaleType = xlLinear
- End With
- End With
- End With
- End If
-
- Application.ScreenUpdating = True
- Application.OnTime T + TimeValue("00:01:00"), "GetDDE" ' ¶¡¹j 5 ¤ÀÄÁ§ï¦¨ TimeValue("00:05:00")
- End Sub
½Æ»s¥N½X |
|