lankybones
New Member
- Joined
- Aug 9, 2010
- Messages
- 4
Forgive me if I am wrong but I cannot find the answer to my question on other threads so I am going to ask.
Background Info:
Using - Excel 2007 through windows xp
I am accessing a SQL server to retrieve a table of data. I am then using a macro to open a userform in which the user inputs data to filter the table by. When they hit the command button after inputting said data the macro filters the columns by the data input from the user then creates 3 charts from the data after filtering.
The Problem:
The user may want to run this macro more than once per workbook so the worksheets created I have running as a string and variable that counts the number of times the macro runs through a public variable, that puts a number after the string (ex. on first run of macro "sheet 1" is created, on second run of macro "sheet 2" is made). My problem is referencing these variable names in the seriescollection in the creation of the charts. My charts show up blank (no data points).
Code:
intGraphButt*******s - variable for number of times graph button was hit
"Neg.Commit Data " & intGraphButt*******s - variable sheet name
Sheets.Add.Name = "Neg.Commit Data " & intGraphButt*******s (no problems with sheet name being correct)
Charts("Negotiated Commit Dates " & intGraphButt*******s).SeriesCollection(1).XValues = "='Neg.Commit Data & intGraphButt*******s'!$A$2:$A$32000"
(within this line of code is where the problem lays)
Respond with any questions or clarifications i need to make Thanks for your time!
Background Info:
Using - Excel 2007 through windows xp
I am accessing a SQL server to retrieve a table of data. I am then using a macro to open a userform in which the user inputs data to filter the table by. When they hit the command button after inputting said data the macro filters the columns by the data input from the user then creates 3 charts from the data after filtering.
The Problem:
The user may want to run this macro more than once per workbook so the worksheets created I have running as a string and variable that counts the number of times the macro runs through a public variable, that puts a number after the string (ex. on first run of macro "sheet 1" is created, on second run of macro "sheet 2" is made). My problem is referencing these variable names in the seriescollection in the creation of the charts. My charts show up blank (no data points).
Code:
intGraphButt*******s - variable for number of times graph button was hit
"Neg.Commit Data " & intGraphButt*******s - variable sheet name
Sheets.Add.Name = "Neg.Commit Data " & intGraphButt*******s (no problems with sheet name being correct)
Charts("Negotiated Commit Dates " & intGraphButt*******s).SeriesCollection(1).XValues = "='Neg.Commit Data & intGraphButt*******s'!$A$2:$A$32000"
(within this line of code is where the problem lays)
Respond with any questions or clarifications i need to make Thanks for your time!