Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help needed with macro

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.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default help needed with macro

sort your data by UIC so the the
Date out is followed by the
Date in lines.

assume the first entry is in row 2 and the date for the row is in column D,
UIC code in Column A

In column E for example, put in a formula like this

=if(A2=A3,D3-D2,if(A2<A1,"Not Returned",""))

then drag fill this down the column.

Adjust D3-D2 to reflect the number of days - if the start date is counted,
D3-D2+1 for example.

you can then apply an autofilter (Data=Filter=Autofilter) and in column E
select the dropdown, select custom and set the conditions does not equal
"Not Returned" and does not equal "". This will just show the returned
items (row showing when they went out) with the number of days they were
out. You can select the data and copy and paste (edit=Paste Special =
Values) to another sheet. Only the visible rows will be copied.

--
Regards,
Tom Ogilvy


"Lorraine" wrote in 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.





  #3   Report Post  
Posted to microsoft.public.excel.programming
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.



.

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
Macro Help Needed sb1920alk Excel Discussion (Misc queries) 0 December 7th 07 09:54 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro help needed CLR Excel Discussion (Misc queries) 0 November 30th 06 03:23 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 02:31 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"