Macro questions

cralx2k

New Member
Joined
Aug 2, 2015
Messages
4
I have some questions about this macro, that I used to make a chart. I'm a newbie creating macros. Thanks so much and sorry for so many questions.

How do I make this macro work on a different user's computer?
ActiveChart.ApplyChartTemplate ( _
"C:\Users\student\AppData\Roaming\Microsoft\Templates\Charts\Chart1.crtx")

How to do I change this section to be able to run this macro in different WorkSheet's name (ex:07102015DD, 07102015AA, 07102015BB)?
ActiveChart.SetSourceData Source:=Range( _
"'07102015DD'!$M:$M,'07102015DD'!$H:$H")

How do I rename this chart "Chart2" to a cell name inside of WorkSheet (07102015DD)?
Sheets("Chart2").Select



=======================

Sub Chart_M()
'
' Chart Macro

Range("D1:G1").Select
Selection.Copy
Range("L1").Select
ActiveSheet.Paste
Range("K2").Select
Application.CutCopyMode = False
Range("M:M,H:H").Select
Range("H1").Activate
ActiveSheet.Shapes.AddChart2(201, xlColumnClustered).Select
ActiveChart.ApplyChartTemplate ( _
"C:\Users\cabido\AppData\Roaming\Microsoft\Templates\Charts\Chart1.crtx")
ActiveChart.SetSourceData Source:=Range( _
"'07102015DD'!$M:$M,'07102015DD'!$H:$H")
ActiveChart.Location Where:=xlLocationAsNewSheet


Sheets("Chart2").Select
With ActiveWorkbook.Sheets("Chart2").Tab
.Color = 49407
.TintAndShade = 0
End With
End Sub


==============================
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,226,693
Messages
6,192,471
Members
453,726
Latest member
JoeH57

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top