PDA

View Full Version : Solved: Selecting Range based on criteria?



itipu
02-22-2007, 01:08 AM
Hi all!

I have a reporting macro/spreadsheet, which dumps some info from Active Directory...

Lets say I have columns A & B, in column A I have a list of machines, in column B I have a list of last logon times...

I know how to e-mail from Excel a range("B15:B20") <-- for example... but what I want to do is to select a range based on the last logon times:


Machine Name Last Logon
HOUIC-S-005 23/01/2007 16:23
AMSDC1-S-601 15/01/2007 03:13
AMSDC1-S-600 19/01/2007 11:37
HOUIC-S-091 15/02/2007 06:50
PHC-S-01012 20/02/2007 08:38
AMSDC2-S-01364 20/02/2007 03:05
NOR-S-01000 16/02/2007 15:49
AMSDC2-S-01572 09/02/2007 16:19
AMSDC1-S-01432 14/02/2007 03:10
abe-u-d00068 No Local Logon

So first I need to sort data by LastLogon (not sure how to do that programmatically)

Then choose range in a form (A1:Ax;B1,Bx) <-- not sure if thats right, based on data in Last Logon which is
a) equals to "No Local Logon"
b) 2 months less then todays date...

Any suggestions on how to do this?

Your help would be much appreciated! Thanks a lot, Mike

Bob Phillips
02-22-2007, 03:30 AM
Post the workbook to help us, and maybe kill the other thread?