excel - Next without For Error - What is wrong with this code? -
i assume there wrong code below, because giving me following error: compile error: next without for
what wrong code? thanks! :)
sub createcharts() dim integer = 3 5 col = columns(i).select dim xaxis range dim yaxis range set yaxis = range("$" & col & "$152", "$" & col & "$156") set xaxis = range("$a$152", "$a$156") dim c chart set c = activeworkbook.charts.add set c = c.location(where:=xllocationasobject, name:="sheet1") c.charttype = xlcolumnclustered dim s series set s = c.seriescollection.newseries s .values = yaxis .xvalues = xaxis next end sub
you missing end with
:
s .values = yaxis .xvalues = xaxis end ' <====== here next
Comments
Post a Comment