Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Current File
I have a pricing spreadsheet which I typically modify and save for each
prospect under the account name. As such, I have t go into the code and replace all the current filename references. There must be a better way to do this... Any ideas, please? Thanks much, Jim Berglund |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Current File
Make the active.name a variable and use that in your code.
-- David "Jim Berglund" wrote: I have a pricing spreadsheet which I typically modify and save for each prospect under the account name. As such, I have t go into the code and replace all the current filename references. There must be a better way to do this... Any ideas, please? Thanks much, Jim Berglund |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Current File
I'm sure he meant to tell you to use the refence as
Activeworkbook.Name as a varialbe rather than Workbooks("MyWorkbook.xls") reference also you could refer to the workbook as ThisWorkbook.Worksheets(1).Range("A1") or ActiveWorkbook.Worksheets(1).Range("A1") -- When you lose your mind, you free your life. "David" wrote: Make the active.name a variable and use that in your code. -- David "Jim Berglund" wrote: I have a pricing spreadsheet which I typically modify and save for each prospect under the account name. As such, I have t go into the code and replace all the current filename references. There must be a better way to do this... Any ideas, please? Thanks much, Jim Berglund |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Current File
A little difficult to comment on without seeing some code. That being said...
Thisworkbook. 'Always refers to the bookk that is executing the code Activeworkbook. 'refers to whichever book happens to be active at the time You can also use workbook objects kind of like this dim wbk as workbook set wbk = activeworkbook 'Now you can always make reference to the workbook that was acive when this line of code was run, even if you activate a different workbook... -- HTH... Jim Thomlinson "Jim Berglund" wrote: I have a pricing spreadsheet which I typically modify and save for each prospect under the account name. As such, I have t go into the code and replace all the current filename references. There must be a better way to do this... Any ideas, please? Thanks much, Jim Berglund |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Current File
Thanks for your advice.
I just entered Workbook()1.Activate and it seemed to work! Jim "Jim Berglund" wrote in message news:3ZtGf.466350$2k.393433@pd7tw1no... I have a pricing spreadsheet which I typically modify and save for each prospect under the account name. As such, I have t go into the code and replace all the current filename references. There must be a better way to do this... Any ideas, please? Thanks much, Jim Berglund |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
reading from another file and pasting to current file, "combobox" | New Users to Excel | |||
Close Current File Then Open New file | Excel Programming | |||
path to current file... | Excel Programming | |||
changing current directory to that of the current open file | Excel Programming | |||
Saving a file with VBA that references current file name | Excel Programming |