ActiveChart.SetSourceData ¨Ó·½¸ê®Æ°ÝÃD (¤v¸Ñ¨M)
- ©«¤l
- 135
- ¥DÃD
- 19
- ºëµØ
- 0
- ¿n¤À
- 165
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- »´ä
- µù¥U®É¶¡
- 2010-12-9
- ³Ì«áµn¿ý
- 2012-8-27
|
ActiveChart.SetSourceData ¨Ó·½¸ê®Æ°ÝÃD (¤v¸Ñ¨M)
¥»©«³Ì«á¥Ñ FAlonso ©ó 2011-3-13 15:21 ½s¿è
¾Þ§@ì·N¬O¦bB2¿ï¾Ü¶}©l¤é´Á,B3¿ï¾Üµ²§ô¤é´Á,B4¿ï¾Ü¼Æ¾Ú¦C(¨Ò¦p³Ì°ªÈ,³Ì§CÈ)µ¥,¦A³z¹Lµ{¦¡Ã¸µe¸Ó¼Æ¾Ú¦Cªº¹Ïªí
¥H¤Uµ{¦¡¦¨¥\¹B¦æ- Sub plotgraph()
- Dim myrange As Range, error As Boolean, x As Integer, y As Integer, mycolumn, mytitle
- With Sheet1
- .Activate
- .[a1].Activate
- End With
- error = False
- x = 0
- y = 0
- mytitle = [b4].Value
- If [b2] = "" Or [b3] = "" Then
- MsgBox "No date"
- Exit Sub
- End If
- If DateValue([a8]) > DateValue([b2]) Then
- MsgBox "Before starting period"
- error = True
- End If
- If DateValue([b3]) > DateValue([a41]) Then
- MsgBox "After ending period"
- error = True
- End If
- If error = True Then
- Exit Sub
- End If
- For Each myrange In Range([a8], [a65536].End(xlUp))
- If DateValue(myrange) >= DateValue([b2]) Then
- x = myrange.Row
- Exit For
- End If
- Next
- For Each myrange In Range([a8], [a65536].End(xlUp))
- If DateValue(myrange) > DateValue([b3]) Then
- y = myrange.Row - 1
- Exit For
- End If
- Next
- If mytitle = "¶}½L" Then
- mycolumn = "B"
- ElseIf mytitle = "³Ì°ª" Then
- mycolumn = "C"
- ElseIf mytitle = "³Ì§C" Then
- mycolumn = "D"
- ElseIf mytitle = "¦¬½L" Then
- mycolumn = "E"
- End If
- Sheet1.ChartObjects(1).Select
- ActiveChart.HasTitle = True
- ActiveChart.ChartTitle.Text = mytitle
- ActiveChart.HasLegend = False
- ActiveChart.SetSourceData Source:=Sheet1.Range("A" & x & ":" & "A" & y & "," & mycolumn & x & ":" & mycolumn & y), PlotBy:=xlColumns
- With Sheet1
- .Activate
- .[a1].Activate
- End With
- End Sub
½Æ»s¥N½X |
|
80 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X
|
|
|
|
|
- ©«¤l
- 135
- ¥DÃD
- 19
- ºëµØ
- 0
- ¿n¤À
- 165
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- »´ä
- µù¥U®É¶¡
- 2010-12-9
- ³Ì«áµn¿ý
- 2012-8-27
|
¥»©«³Ì«á¥Ñ FAlonso ©ó 2011-3-13 15:22 ½s¿è
½Ð°Ñ¦Ò¥H¤Wµ{¦¡ |
|
80 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X
|
|
|
|
|