Please try this:
Private Sub CommandButton1_Click() Dim iT1 As Integer Dim iT2 As Integer iT1 = Trend1.TraceCount iT2 = Trend2.TraceCount Dim bTrace As Boolean If iT1 <> iT2 Then MsgBox "Trace is different between Trend1 (" & Str(iT1) & ") and Trend2 (" & Str(iT2) & ")." Exit Sub End If For i = 1 To iT1 Trend2.CurrentTrace = i Trend1.CurrentTrace = i bTrace = Trend1.ShowTrace Trend2.ShowTrace = bTrace Next End Sub
Edit: I misread your question the first time. Sorry. I tried to get the index of the Trace a user clicked but it looks as if Trend.CurrentTrace is not affected by clicking a Trace. You should however be able to accomplish what you like by iterating through Traces and assign the value of the ShowTrace property from Trend1 to Trace2 in the Trend1_Click event with code similar to what I've posted above.