Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default possible to subtract 2 dates from a closed workbook?

i have starting dates in a workbook called dates in range B1:B12 (the closed
workbook)
i am trying to subtract one from the another to come up with the number of days.
i can get it to work if dates is open.

tried this, doesn't work but don't want to spin my wheels if it's not possible.
sheet numbers are 1 to 12.

pDays = Application.Evaluate("='" & fPath & "[dates.xls]sheet1'!$b$" & sht.Index
+ 1) - _
Application.Evaluate("='" & fPath & "[dates.xls]sheet1'!$b$" &
sht.Index) - 1


is it possible?

--


Gary



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default possible to subtract 2 dates from a closed workbook?

i think i'll just add a column and do the subtraction in the dates workbook, and
then reference that cell. seems much easier.


--


Gary


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
i have starting dates in a workbook called dates in range B1:B12 (the closed
workbook)
i am trying to subtract one from the another to come up with the number of
days.
i can get it to work if dates is open.

tried this, doesn't work but don't want to spin my wheels if it's not
possible. sheet numbers are 1 to 12.

pDays = Application.Evaluate("='" & fPath & "[dates.xls]sheet1'!$b$" &
sht.Index + 1) - _
Application.Evaluate("='" & fPath & "[dates.xls]sheet1'!$b$" &
sht.Index) - 1


is it possible?

--


Gary





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default possible to subtract 2 dates from a closed workbook?



On Oct 9, 2:28 pm, "Gary Keramidas" <GKeramidasATmsn.com wrote:
i have starting dates in a workbook called dates in range B1:B12 (the closed
workbook)
i am trying to subtract one from the another to come up with the number of days.
i can get it to work if dates is open.

tried this, doesn't work but don't want to spin my wheels if it's not possible.
sheet numbers are 1 to 12.

pDays = Application.Evaluate("='" & fPath & "[dates.xls]sheet1'!$b$" & sht.Index
+ 1) - _
Application.Evaluate("='" & fPath & "[dates.xls]sheet1'!$b$" &
sht.Index) - 1

is it possible?


Yes - just link the workbook you are working in to the 'closed' one.
as long as you indicate that it is ok to update when you open the WB,
you'll be in business

HTH

AR

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default possible to subtract 2 dates from a closed workbook?

Yes it is possible.

I assume you are familiar with John Walkenbach's example at
http://j-walk.com/ss/excel/tips/tip82.htm

however, in my experience, it is faster to put a linking formula in a cell,
then replace the formula with the value returned or pick up that value and
clear the cell.

--
Regards,
Tom Ogilvy



"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
i have starting dates in a workbook called dates in range B1:B12 (the
closed workbook)
i am trying to subtract one from the another to come up with the number of
days.
i can get it to work if dates is open.

tried this, doesn't work but don't want to spin my wheels if it's not
possible. sheet numbers are 1 to 12.

pDays = Application.Evaluate("='" & fPath & "[dates.xls]sheet1'!$b$" &
sht.Index + 1) - _
Application.Evaluate("='" & fPath & "[dates.xls]sheet1'!$b$" &
sht.Index) - 1


is it possible?

--


Gary





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default possible to subtract 2 dates from a closed workbook?

i wasn't, but i see it now. i added a formula in the closed workbook to do the
math and just used a linking formula to that cell.

thanks
--


Gary


"Tom Ogilvy" wrote in message
...
Yes it is possible.

I assume you are familiar with John Walkenbach's example at
http://j-walk.com/ss/excel/tips/tip82.htm

however, in my experience, it is faster to put a linking formula in a cell,
then replace the formula with the value returned or pick up that value and
clear the cell.

--
Regards,
Tom Ogilvy



"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
i have starting dates in a workbook called dates in range B1:B12 (the closed
workbook)
i am trying to subtract one from the another to come up with the number of
days.
i can get it to work if dates is open.

tried this, doesn't work but don't want to spin my wheels if it's not
possible. sheet numbers are 1 to 12.

pDays = Application.Evaluate("='" & fPath & "[dates.xls]sheet1'!$b$" &
sht.Index + 1) - _
Application.Evaluate("='" & fPath & "[dates.xls]sheet1'!$b$" &
sht.Index) - 1


is it possible?

--


Gary







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
Subtract if dates in the range between 2 dates. inta251 via OfficeKB.com Excel Worksheet Functions 2 March 1st 07 04:40 AM
Subtract two dates Joe Excel Discussion (Misc queries) 2 February 8th 06 02:57 AM
How do you Subtract dates in VBA postlp60[_3_] Excel Programming 1 August 19th 05 10:46 PM
copy worksheet from closed workbook to active workbook using vba mango Excel Worksheet Functions 6 December 9th 04 07:55 AM
subtract dates jrh Excel Programming 1 March 4th 04 04:05 PM


All times are GMT +1. The time now is 02:54 AM.

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"