largeselection
Active Member
- Joined
- Aug 4, 2008
- Messages
- 358
Let's see if this is even possible...Perhaps with a userfield or some such?...
I have to change the name of a file referenced in a macro as the days pass by. Rather than having to step into the code and manually changing the file name is there a way to have a prompt that will change it for me.
Here is the code to clarify:
Dim MyFile As Workbook
Set MyFile = ActiveWorkbook
Dim MyTarget As Workbook
Set MyTarget = Workbooks("Week 28 O.xls")
MyTarget.Activate
Range("D190").Select
ActiveWindow.SmallScroll Down:=-30
Range("A160:E160").Select
Range(Selection, Selection.End(xlDown)).Select............
I will have to change the week 28 to 29,30,31, etc. I was wondering if rather than steping into the code and physically changing the number from 28 to 29 would it be possible so that when I click my custom "run macro" button it prompts me for the correct number or file?
Or perhaps is it possible to program in something where it will reference the workbook name from a cell and I can program in some code that will create a cell that has the same name as the workbook.
What are your thoughts?
I have to change the name of a file referenced in a macro as the days pass by. Rather than having to step into the code and manually changing the file name is there a way to have a prompt that will change it for me.
Here is the code to clarify:
Dim MyFile As Workbook
Set MyFile = ActiveWorkbook
Dim MyTarget As Workbook
Set MyTarget = Workbooks("Week 28 O.xls")
MyTarget.Activate
Range("D190").Select
ActiveWindow.SmallScroll Down:=-30
Range("A160:E160").Select
Range(Selection, Selection.End(xlDown)).Select............
I will have to change the week 28 to 29,30,31, etc. I was wondering if rather than steping into the code and physically changing the number from 28 to 29 would it be possible so that when I click my custom "run macro" button it prompts me for the correct number or file?
Or perhaps is it possible to program in something where it will reference the workbook name from a cell and I can program in some code that will create a cell that has the same name as the workbook.
What are your thoughts?