Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default 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   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
reading from another file and pasting to current file, "combobox" Darius New Users to Excel 1 September 26th 05 07:13 AM
Close Current File Then Open New file Steve Roberts Excel Programming 1 March 31st 05 02:08 AM
path to current file... daschund Excel Programming 1 August 31st 04 11:45 PM
changing current directory to that of the current open file unnameable Excel Programming 2 May 19th 04 11:14 AM
Saving a file with VBA that references current file name chilidog1000 Excel Programming 2 October 17th 03 08:14 PM


All times are GMT +1. The time now is 04:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"