hi!
i want to introduce a number in the textbox1, and that number sets which entire row to select for making a chart. i thought of something like this, but i cant put the variable x just like that. please help!
Private Sub CommandButton1_Click()
Dim x As String
If TextBox1.Text <> "" Then
x = TextBox1.Text
Range("Ax:Mx").EntireRow.Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range("'sheet1'!$A$x:$M$x")
ActiveChart.ChartType = xlLineStacked
UserForm1.Hide
End If
End Sub
Bookmarks