syps
03-10-2008, 02:30 AM
Hi all,
Am new in VBA, am trying to update some data daily in a columns rather thanin rows.
Below are the code that i have try but failed..
Private Sub RNC1_Click()
Dim Z As String
Z = ActiveSheet.UsedRange.Columns.Count
MsgBox (Z)
Sheets("Voicedropgraph").Select
ActiveChart.PlotArea.Select
ActiveChart.SetSourceData Source:=Sheets("RRC_drop").Range("A1:" & Z & " 1 ,A2:" & Z & " 2"), _
PlotBy:=xlRows
End Sub
Pls advice on what shoud be the "Z" if my column is variabe.
Pls advice, am thing if it is the columns.count is wrong.
Thanks in advance:yes
Am new in VBA, am trying to update some data daily in a columns rather thanin rows.
Below are the code that i have try but failed..
Private Sub RNC1_Click()
Dim Z As String
Z = ActiveSheet.UsedRange.Columns.Count
MsgBox (Z)
Sheets("Voicedropgraph").Select
ActiveChart.PlotArea.Select
ActiveChart.SetSourceData Source:=Sheets("RRC_drop").Range("A1:" & Z & " 1 ,A2:" & Z & " 2"), _
PlotBy:=xlRows
End Sub
Pls advice on what shoud be the "Z" if my column is variabe.
Pls advice, am thing if it is the columns.count is wrong.
Thanks in advance:yes