running macro's in Excel 2007

T

Texas Tonie

Quick question,

How can I replace a VB macro I run in Excel 2003 with a similar function in
Excel 2007.

the Macro sets a rolling date range in charts in the workbook.

I printed out the Excel 2003 macro below - do I just need to re-record it in
Excel 2007?

A boggled TexasTonie

Dim MinDate As Long
Dim MaxDate As Long

Sheets("ChartdatesRefresh").Select

Range("c2").Select
MinDate = ActiveCell.Value
Range("c3").Select
MaxDate = ActiveCell.Value

'
Sheets("MPC Daily").Select
ActiveChart.Axes(xlCategory).Select
With ActiveChart.Axes(xlCategory)
.MinimumScale = MinDate
.MaximumScale = MaxDate
End With
Sheets("GPC Daily").Select
ActiveChart.Axes(xlCategory).Select
With ActiveChart.Axes(xlCategory)
.MinimumScale = MinDate
.MaximumScale = MaxDate
End With
Sheets("Daily P Centers").Select
ActiveChart.Axes(xlCategory).Select
With ActiveChart.Axes(xlCategory)
.MinimumScale = MinDate
.MaximumScale = MaxDate
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top