View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Charlie Charlie is offline
external usenet poster
 
Posts: 703
Default Shortening a formula

....or even put the workbook name in a local named cell (to be able to edit it
later)

ActiveWorkbook.Names.Add _
Name:="DailyDBMA1", _
RefersTo:=DailyDBMAWorkBook & "!$D$10:$AG$10"

ActiveWorkbook.Names.Add _
Name:="DailyDBMA2", _
RefersTo:=DailyDBMAWorkBook & "!$D$18:$AG$18"

ActiveWorkbook.Names.Add _
Name:="DailyDBMA3", _
RefersTo:=DailyDBMAWorkBook & "!$D$19:$AG$19"

(put the filepath string in the named cell using two tick marks to start,
i.e. ''...)

"Charlie" wrote:

I was just trying to figure that part out. Maybe like this:

ActiveWorkbook.Names.Add _
Name:="DailyDBMA1", _
RefersTo:="'C:\Departments\Operations\DBMA Team\DBMA\DBMA Reports\DAILY
Daily DBMA information\[Daily account DBMA information 200607.xls]Daily DBMA
information'!$D$10:$AG$10"

ActiveWorkbook.Names.Add _
Name:="DailyDBMA2", _
RefersTo:="'C:\Departments\Operations\DBMA Team\DBMA\DBMA Reports\DAILY
Daily DBMA information\[Daily account DBMA information 200607.xls]Daily DBMA
information'!$D$18:$AG$18"

in formula use:

=IF(I56=TODAY(),"N/A",SUMPRODUCT(--(DailyDBMA1<=I56),DailyDBMA2/(SUMPRODUCT(--(

...etc.


"Tom Ogilvy" wrote:

Yes if the other workbook is open - use the Indirect function to build the
reference

No if the other workbook is closed - at least know with any builtin
functionality.


It might be easier to use hardcode defined names (insert=Name=Define) and
change that/those.
--
Regards,
Tom Ogilvy


"GTVT06" wrote:

That would work, but can you call file paths in a formula from another
cell like that? I don't know if that's possible.

Charlie wrote:
All I can say is "Geez!" That formula would have me so cross-eyed I'd need
to scratch my eyes with eyeball forks! Can you put the filename in a cell
(maybe even on a hidden sheet), name the cell "DailyDBMA" or something, and
use that name in your formula?