Results 1 to 20 of 21

Thread: EXCEL (macro) - Analysis of hourly intervals from sectional graph, correlation

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    I am sorry, i attached file of excel and below code for sectional graph. is it right now?

    Sub Úsek_grafu()
    
    Dim radky As Integer
    Dim bunka_start As String
    Dim bunka_konec As String
    Dim pocatek As Integer
    Dim index_start, index_konec As Integer
    'zvoleny radek
    pocatek = ActiveCell.Row
    'zjisteni pocet radku
    For a = 3 To 65555
    If Cells(a, 3) =  Then
    radky = a - 1
    Exit For
    End If
    Next
    'omezeni pro zacatek a konec grafu
    If pocatek  60 Then
    index_start = 3
    Else
    index_start = pocatek - 60
    End If
    If pocatek + 120  radky Then
    index_konec = radky
    Else
    index_konec = pocatek + 120
    End If
    
    'prevede na format A1
    bunka_start = Cells(index_start, 3).Address(RowAbsolute=False, ColumnAbsolute=False)
    bunka_konec = Cells(index_konec, 8).Address(RowAbsolute=False, ColumnAbsolute=False)
    
    'vytvori graf
    '
    ActiveSheet.Shapes.AddChart.Select
    ActiveChart.ChartType = xlLine
    ActiveChart.SetSourceData Source=Range(bunka_start &  & bunka_konec)
    
    End Sub

    Thank you very much.
    Attached Files Attached Files
    Last edited by jezurka; 01-07-2018 at 04:12 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •