Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 16
Default Filter in between dates

Hi Everyone,

Using Excel 2003. I have a list of patients who were on a particular
therapy and in a certain unit. Many where on the therapy in other units
before getting transferred or on the therapy after they left. I need to
find the patients who started on a therapy after they arrived in a unit and
who were off the therapy before they left the unit. My Date units show me
Date and Time in the same field. They are named..

PtLocStDtTm
PtLocEndDtTm
PtThpyStDtTm
PtThpyEndDtTm

Thanks,
Linda


  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10,124
Default Filter in between dates

If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Linda RQ" wrote in message
...
Hi Everyone,

Using Excel 2003. I have a list of patients who were on a particular
therapy and in a certain unit. Many where on the therapy in other units
before getting transferred or on the therapy after they left. I need to
find the patients who started on a therapy after they arrived in a unit
and who were off the therapy before they left the unit. My Date units
show me Date and Time in the same field. They are named..

PtLocStDtTm
PtLocEndDtTm
PtThpyStDtTm
PtThpyEndDtTm

Thanks,
Linda


  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 16
Default Filter in between dates

Sent....thanks


"Don Guillett" wrote in message
...
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Linda RQ" wrote in message
...
Hi Everyone,

Using Excel 2003. I have a list of patients who were on a particular
therapy and in a certain unit. Many where on the therapy in other units
before getting transferred or on the therapy after they left. I need to
find the patients who started on a therapy after they arrived in a unit
and who were off the therapy before they left the unit. My Date units
show me Date and Time in the same field. They are named..

PtLocStDtTm
PtLocEndDtTm
PtThpyStDtTm
PtThpyEndDtTm

Thanks,
Linda




  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10,124
Default Filter in between dates

This should do it. File returned to OP

Sub GetReportSAS()
Application.ScreenUpdating = False
Dim dlr As Long
Dim i As Long
Dim ss As Worksheet

Set ss = Sheets("Report")
dlr = ss.Cells(Rows.Count, 1).End(xlUp).Row
ss.Rows(9).Resize(dlr - 8).Delete

With Sheets("Data")
For i = 9 To .Cells(Rows.Count, 1).End(xlUp).Row
dlr = ss.Cells(Rows.Count, 1).End(xlUp).Row + 1
If Not .Cells(i, "h") < .Cells(i, "g") And _
Not .Cells(i, "j") .Cells(i, "I") Then _
.Rows(i).Copy ss.Cells(dlr, 1)
Next i
End With
Application.ScreenUpdating = True
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Linda RQ" wrote in message
...
Just tried again....Linda


"Don Guillett" wrote in message
...
Didn't get to me

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Linda RQ" wrote in message
...
Sent....thanks


"Don Guillett" wrote in message
...
If desired, send your file to my address below. I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Linda RQ" wrote in message
...
Hi Everyone,

Using Excel 2003. I have a list of patients who were on a particular
therapy and in a certain unit. Many where on the therapy in other
units before getting transferred or on the therapy after they left. I
need to find the patients who started on a therapy after they arrived
in a unit and who were off the therapy before they left the unit. My
Date units show me Date and Time in the same field. They are named..

PtLocStDtTm
PtLocEndDtTm
PtThpyStDtTm
PtThpyEndDtTm

Thanks,
Linda








  #7   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 16
Default Filter in between dates

Thanks Don! Gee, I think that is VB code but didn't realize it could be
used in excel and I don't know what the heck it says but the first 100
records of your report matches my hand done version so I guess I am done
with this part of the project. I was hoping it was something I could learn
to do but I don't think so yet.

Thanks,
Linda

"Don Guillett" wrote in message
...
This should do it. File returned to OP

Sub GetReportSAS()
Application.ScreenUpdating = False
Dim dlr As Long
Dim i As Long
Dim ss As Worksheet

Set ss = Sheets("Report")
dlr = ss.Cells(Rows.Count, 1).End(xlUp).Row
ss.Rows(9).Resize(dlr - 8).Delete

With Sheets("Data")
For i = 9 To .Cells(Rows.Count, 1).End(xlUp).Row
dlr = ss.Cells(Rows.Count, 1).End(xlUp).Row + 1
If Not .Cells(i, "h") < .Cells(i, "g") And _
Not .Cells(i, "j") .Cells(i, "I") Then _
.Rows(i).Copy ss.Cells(dlr, 1)
Next i
End With
Application.ScreenUpdating = True
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Linda RQ" wrote in message
...
Just tried again....Linda


"Don Guillett" wrote in message
...
Didn't get to me

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Linda RQ" wrote in message
...
Sent....thanks


"Don Guillett" wrote in message
...
If desired, send your file to my address below. I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Linda RQ" wrote in message
...
Hi Everyone,

Using Excel 2003. I have a list of patients who were on a particular
therapy and in a certain unit. Many where on the therapy in other
units before getting transferred or on the therapy after they left.
I need to find the patients who started on a therapy after they
arrived in a unit and who were off the therapy before they left the
unit. My Date units show me Date and Time in the same field. They
are named..

PtLocStDtTm
PtLocEndDtTm
PtThpyStDtTm
PtThpyEndDtTm

Thanks,
Linda










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
Filter on Dates suek Excel Discussion (Misc queries) 4 August 11th 08 04:21 PM
Filter Dates? Ken Excel Discussion (Misc queries) 4 February 20th 07 09:27 PM
How to filter out all the partial dates from a big list of dates? Tiwarr Excel Discussion (Misc queries) 1 September 14th 06 05:35 PM
Filter dates by the day Chris AM Excel Discussion (Misc queries) 2 September 12th 06 05:16 PM
how to filter dates? abigail New Users to Excel 2 August 18th 05 12:45 AM


All times are GMT +1. The time now is 09:18 PM.

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"