Pessoal me ajude por favor... preciso construir gráficos baseados em uma planilha que é aumenta tanto de linhas como de colunas, assim precisei montar uma variavel para calcular linhas e colunas, só que na hora de montar o gráfico via VBA, não consigo escrever o range com a variavel. me ajudem por favor !
segue o código
IDENTIFICANDO TABELAS
lin_col = 1
col_col = 1
lin_set = 1
col_set = col_col + 1
While Cells(1, col_col) <> ""
col_col = col_col + 1
Wend
While Cells(lin_col, 1) <> ""
lin_col = lin_col + 1
Wend
'gráfico de média.col
Sheets("Relatório").Select
    Cells(1, 1000).Select
    Charts.Add
    ActiveChart.ChartType = xlColumnClustered
    ActiveChart.SeriesCollection.NewSeries
    ActiveChart.SeriesCollection(1).Name = "Média.Col"
    'assim que tenho tentado montar
    ActiveChart.SeriesCollection(1).Values = "=Relatório!" & Range(Cells(2, col_col - 1), Cells(lin_col - 1, col_col - 1))
    'seria esse o range atual, mas para frente ele mudaria 'K2:K4"
    'assim ele da certo, mas preciso que seja sem o range fechado
    ActiveChart.SeriesCollection(1).XValues = "=Relatório!B2:B4"
    ActiveChart.Location where:=xlLocationAsNewSheet, Name:="Nota Méd.Col"
    ActiveChart.HasTitle = True
    ActiveChart.ChartTitle.Text = "Nota Média Por Colaborador"
    ActiveChart.Axes(xlValue).Select
    ActiveChart.Axes(xlValue).MaximumScale = 10
    ActiveChart.SeriesCollection(1).Select
    ActiveChart.SetElement (msoElementDataLabelOutSideEnd)
    ActiveChart.ClearToMatchStyle
    ActiveChart.ChartStyle = 26
    ActiveChart.ClearToMatchStyle
                                                                                                	                                                
	                                         
                    
                    	
                            Postado : 07/04/2014 10:44 am