Populating a chart with Updating information
Excellent, Here is the your code slightly modified to fit my application
Sub newrange()
Dim X As Integer, Y As Integer
For X = 1 To 25
If Cells(2, X) 0 Or Cells(3, X) 0 Then Y = X
Next
Range(Cells(1, Y - 10), Cells(3, Y)).Select
Selection.Copy
Sheets("Sheet1").Select
ActiveSheet.Range("A10").Select
Selection.PasteSpecial
End Sub
And here is another example of the Chart that i am copying from and pasting
into specific cells
12/11/2005 12/18/2005 12/25/2005 1/1/2006
2 9 4
0
34 19 3
0
The problem with this code is that sometimes the data that is returned is
going to be both zero's. As you can see that the data is put into weekending
catogeries. I would some how like to use the code to look at the current
date and then copy and paste the cells that are under that date ending. So
if the current date was 12/21/2005 then everything from 12/25/2005 back to
12/11/2005 would be copied and pasted. If the current date is 12/29/2005
then everything from under 1/1/2006 to 12/18/2005be copied and pasted. All
the data that is collected during a week is stored under the last day of that
week.
|