View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default Extracting portion of filename

Look up the NETWORKDAYS and WORKDAY ATP functions in help.

--
__________________________________
HTH

Bob

"HappySenior" wrote in message
...
Bob, Great solution! - Fits my stated problem perfectly and works
great!
This newbie realized after testing it that all I had to do was modify
my macro that creates the worksheets to go to C1 and enter the date
variable I created and then go to e1 to post the same date -1 so that
I would be able to compute the change in values for two consecutive
days in a 365 day operation.

My next variation will be to create worksheets for businesses that are
not open on certain days like weekends or holidays. The holiday part
will require a holiday schedule for the business, the rest should be
easy. I find it to be fun to tease my mind, now if only I could make
some $ from it...
Don.

On Jul 12, 9:31 am, "Bob Phillips" wrote:
Range("C1").Value = DateValue(Right$(Replace(ActiveWorkbook.Name,
".xls", ""), 10))

--
__________________________________
HTH

Bob

"HappySenior" wrote in message

...



I have a macro that creates a series of workbooks named in the format
"Daily yyyy mm dd" which works fine.
My daily worksheets require a column headed by the date and another
column headed by the preceding day's date. That column links to the
prior day's worksheet to bring forward end of the day values.
I'm a newbie (retired CPA) at VBA and would appreciate suggestions
about how to extract the right 10 characters of the file name and
convert them to a date in cell c1 on sheet 1.
Many thanks
Don- Hide quoted text -


- Show quoted text -