Hello everyone,
I am trying to create a process which will take my data and convert it into a graph. I plan to use macro so that I can convert my data into graph everyday, instantly, with out having to go through the whole process like I do right now.
So I was able to create a macro which converts data into graph. However, this macro only works for file 'Book1'. I think I know what the problem is.
To graph, I am using named ranges to create dynamic charts. ( Please see http://office.microsoft.com/en-us/excel/HA011098011033.aspx ). Now in my source data of my graph, the value formula "Sheet1!time" changes to "Book1!time". Now the problem is that if I run this macro in a new file it doesn't work.
The following line gives me an error. As you can see, "Book1" is the problem. Is there a way I could change "Book1" to "Sheet1" ?
Windows("Book1").SmallScroll Down:=18 'error on this line
ActiveSheet.Shapes("Chart 1").IncrementLeft -32.25
ActiveSheet.Shapes("Chart 1").IncrementTop 331.5
Windows("Sheet1").SmallScroll Down:=42
ActiveSheet.Shapes("Chart 1").IncrementLeft -60.75
ActiveSheet.Shapes("Chart 1").IncrementTop 544.5
Windows("Sheet1").SmallScroll Down:=27
ActiveSheet.Shapes("Chart 1").IncrementLeft -45.75
ActiveSheet.Shapes("Chart 1").IncrementTop 375.75
ActiveSheet.Shapes("Chart 1").ScaleWidth 1.44, msoFalse,
Thanks,
I am trying to create a process which will take my data and convert it into a graph. I plan to use macro so that I can convert my data into graph everyday, instantly, with out having to go through the whole process like I do right now.
So I was able to create a macro which converts data into graph. However, this macro only works for file 'Book1'. I think I know what the problem is.
To graph, I am using named ranges to create dynamic charts. ( Please see http://office.microsoft.com/en-us/excel/HA011098011033.aspx ). Now in my source data of my graph, the value formula "Sheet1!time" changes to "Book1!time". Now the problem is that if I run this macro in a new file it doesn't work.
The following line gives me an error. As you can see, "Book1" is the problem. Is there a way I could change "Book1" to "Sheet1" ?
Windows("Book1").SmallScroll Down:=18 'error on this line
ActiveSheet.Shapes("Chart 1").IncrementLeft -32.25
ActiveSheet.Shapes("Chart 1").IncrementTop 331.5
Windows("Sheet1").SmallScroll Down:=42
ActiveSheet.Shapes("Chart 1").IncrementLeft -60.75
ActiveSheet.Shapes("Chart 1").IncrementTop 544.5
Windows("Sheet1").SmallScroll Down:=27
ActiveSheet.Shapes("Chart 1").IncrementLeft -45.75
ActiveSheet.Shapes("Chart 1").IncrementTop 375.75
ActiveSheet.Shapes("Chart 1").ScaleWidth 1.44, msoFalse,
Thanks,