Run a Macro based on the month

I run monthly reports on data collected

Each Workbook is an individual book for each month e.g. Production Reports Piston Feb.xlsm

I would like to be able to run the macro based on an entry in the report sheet in range AA1, e.g. =CONCATENATE(“Production Report Piston “,X1,V2,””””) where X1 is the Month and V2 is the .xlsm

I want the macro to recognise this range and then run for that month

Here is my proposed code which will not work

Application.Run Range(“AA1”)!Report1.Report1

I currently use this call but whenever i change something in the book i have to go back and change the month.

Application.Run “‘Production Report Piston Feb.xlsm’!Report2.Report2”

Any help would be greatkly appreciated, thanks Jim

2 thoughts on “Run a Macro based on the month

  1. Excel Geek

    Hi there

    You could try something like…

    Application.Run "Production Report Piston " & Cells(24,1) & ".xlsm"

    You might need to reference the sheet name that Cells(24,1) is referring to… so it would look like Sheets("Sheet Name").Cells(24,1)

  2. Jim

    Many thanks for that help I will try that as soon as possible. It certainly sounds right

    Jim

Leave a Reply

Your email address will not be published. Required fields are marked *