steve6501
Board Regular
- Joined
- Jun 18, 2004
- Messages
- 89
Hello
I have shown part of a macro which I recorded which works fine assuming the file is named "bank_analysis_20130417"
What I want is to be able to do the same personal macro to open a file for each day ie 18/04, 19/04 etc etc without having to change the date within the macro each time. I have tried removing the date with no success.
Sub Prepfile()
Columns("D:D").EntireColumn.AutoFit
Columns("D:D").Select
ActiveWorkbook.Worksheets("bank_analysis_20130417").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("bank_analysis_20130417").Sort.SortFields.Add Key:= _
Range("B1"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("bank_analysis_20130417").Sort
.SetRange Range("A2:AB6122")
The macro continues with several more operations to prepare the file use
Am I able to do this please?
Steve
I have shown part of a macro which I recorded which works fine assuming the file is named "bank_analysis_20130417"
What I want is to be able to do the same personal macro to open a file for each day ie 18/04, 19/04 etc etc without having to change the date within the macro each time. I have tried removing the date with no success.
Sub Prepfile()
Columns("D:D").EntireColumn.AutoFit
Columns("D:D").Select
ActiveWorkbook.Worksheets("bank_analysis_20130417").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("bank_analysis_20130417").Sort.SortFields.Add Key:= _
Range("B1"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("bank_analysis_20130417").Sort
.SetRange Range("A2:AB6122")
The macro continues with several more operations to prepare the file use
Am I able to do this please?
Steve