View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Auric__ Auric__ is offline
external usenet poster
 
Posts: 538
Default How to obtain the transit time

Paul wrote:

I have to thank you anyway because you are trying to solve a question
that will help me a lot in the everyday life using your free time.

Before to post the question I tried several solutions, but my knowledge
with Excel and mainly Vba are very very limited.

The routine is working well.
However if I modify the arrival date, lets say in B32 and then insert
another date in B33, the value in B32 is back to original value.
If I not asking to much is there a way to avoid to update the B32 if I
am not working on A32 cell?

Considering 3 as value in A20,
18-gen-2013 - 10:00 23-gen-2013 - 10:00 -- OK
19-gen-2013 - 0:00 24-gen-2013 - 0:00 -- OK
20-gen-2013 - 0:00 22-gen-2013 - 0:00 -- ??

In this case I'll use a conditional formatting to highlight the Sundays.

Thanks for your time and patiente. Congratulations for your high level
of knowledge of Excel/Vba


My code takes the date in column A of the current row (30-60), adds the
number in A20, performs magic to figure out weekends, and then dumps the
result in column B of the current row.

If you change the value of what's in B(30-60), the next time something in A
(30-60) is changed, B will get recalculated, regardless of what you've
manually entered. To get around that, you could, say, bold the B cell
containing your manual entry, then you could change this line:

If IsDate(Cells(L0, 1).Value) Then

to this:

If IsDate(Cells(L0, 1).Value) And _
Not (Cells(L0, 2).Font.Bold) Then

There are other possibilities, of course, but you'd need *some* way of
telling the VBA that it needs to skip that line.

For how long did you learn to achieve this level?


Well... I started programming BASIC in 1983 (age 7). I started VB in '98, and
VBA in '99 or so... but if you hang around here, you'll see that I'm more of
a long-time hobbiest rather than any sort of "expert", and some folks here
make me feel like a novice. There are others that *used* to be here. (If you
ever get an answer by Tom Ogilvy, I'd take his advice over *anybody else's*.
He's a reg at the Excel section of AllExperts now.)

--
Your clothes, give them to me, now.