View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
john john is offline
external usenet poster
 
Posts: 97
Default help needed with macro

I set it up this way with the titles in row 4 and the
following columns:

A B C D E

uic from to out days out
121 ca ma 1-Jan
131 nv ca 5-Jan
121 ma ca 15-Jan 14
131 ca ma 31-Jan 26
111 nv ma 15-Feb still out
141

I put the following in cell E6 and copied down.

=IF(ISNA(VLOOKUP(A6,$A$5:$D5,1,FALSE)),IF(ISNA(VLO OKUP
(A6,A7:$A$10,1)),"still out"," "),D6-VLOOKUP
(A6,$A$5:$D5,4,FALSE))

I put this in cell E5

=IF(ISNA(VLOOKUP(A5,A6:$A$10,1, FALSE)),"still out"," ")

Is this what you were looking for?

John



-----Original Message-----
Hi

I am trying to create a macro for a report that gets
generated regularly from an asset tracking program. It
returns a list with a column for UIC code, a column for
location issued from and one for location issued to plus
a date issued column. So you might have one item issued
out from A to B, then the same item returned from B to A
on a different line. Here's the dilemma, for accounting
purposes I need to track how many days each item was out;
not sure how to do this when it would have to refer to 2
different lines and the second problem is that some items
only went out and didn't come back and so if I sort by
uic, I get two lines for most items but one line for a
few, it also has to track those items that only went out
and didn't come back . Not sure if this is possible but
would sure appreciate any assistance.



.