My last row variable is the last row which contains data in the excel table whereas boundaryRow is a variable who gets the last row value and subtract it by 20 which is last row - 20, but i just cant look for a way to put in my two variables into my ActiveChart.Range. You can specify a different system separator by changing the regional settings in Mac OS X International system preferences. Note: Excel uses the Mac OS system separator for thousands. The Decimal separator and Thousands separator edit boxes displayed once you click on the Use system separators checkbox. On the Home tab, under Number, click Display the value of a cell with a thousands separator. Under the editing options, Click or Tick on the Use system separators checkbox if there is no checkmark in the box. The error part is here ActiveChart.SetSourceData Source:=Range("mySheet!$A$" & boundaryRow ":$B$" & lastrow) 'make sure the range is correct here Click Advanced in the list of items on the left-hand side. Lastrow = mySheet.Range("A" & Rows.Count).End(xlUp).RowĪctiveChart.SetSourceData Source:=Range("mySheet!$A$" & boundaryRow ":$B$" & lastrow) 'make sure the range is correct hereĪctiveChart.FullSeriesCollection(1).ChartType = xlLine 'select which column should be the Line or the ColumnĪctiveChart.FullSeriesCollection(1).AxisGroup = 1 What my macro do is by reading the cell row data and will create a chart by itself for export purpose, etc.īelow is my macro code Sub CombinationChart()Ī2(201, xlColumnClustered).Select I am a new user on Excel VBA, recently i encounter this error when ever i try to run my macro.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |