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

ªø±ø¹Ï¤¤¤£Åã¥Ü

EXCEL¹Ï§Î¥\¯àÀ³¸Ó°µ¤£¨ì¡A¥u·Q¨ì¥ÎVBA
1. »Ý±N¹Ï§Îªº¤ô¥­¶b®y¼Ð¶b¿ï¶µ§ï¬°"¤å¦r®y¼Ð¶b"
2. ¶K¤WVBAµ{¦¡½X, °õ¦æµ{¦¡
Private Sub CommandButton1_Click()
    Dim I As Integer, RNG As Range
   
    With Sheet1
        Set RNG = .Range(.Cells(1, 1), .Cells(1, 4))
        For I = 2 To .Cells.SpecialCells(xlCellTypeLastCell).Row
            If .Cells(I, 5) <> 0 Then
                Set RNG = Union(RNG, .Range(.Cells(I, 1), .Cells(I, 4)))
            End If
        Next I
        .ChartObjects("¹Ïªí 1").Chart.SetSourceData Source:=Range(RNG.Address)
    End With
End Sub

TOP

        ÀR«ä¦Û¦b : §Ú­Ì³Ì¤jªº¼Ä¤H¤£¬O§O¤H¡D¥i¯à¬O¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD