Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ian Ian is offline
external usenet poster
 
Posts: 109
Default Search and Analyse

I have a large spreadsheet (20,000 records) of patient records. I need to
search the records for specific patient IDs and then analyse certain fields
of data in the patient recordset but I'm not quite sure how to go about it.

I'd like to have some code/macro that opens a dialog box requesting my input
for a PatientID field. The code should then locate the relevant records if
that patient exists and if it does look at all the records matching that
PatientID and give me the lowest value of another field (Temp) in that group
of records for that patient.

At present I just use FIND from the menu bar then eyeball the data looking
for my lowest value, but it would be nice to have it automated.

I look forward to any suggestions,

TIA,

Ian.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Search and Analyse

Can you sort the list of records? If so, I would suggest sorting by
PatientID first, then Temp 2nd, both ascending. Then finding the first line
for a given PatientID would automatically bring you to the line with the
lowest Temp. The code could be as simple as:

PatientID = InputBox("Enter the Patient ID:")
Set ResultRange = Range("A1:D7").Columns(1).Find(PatientID)
MinTemp = ResultRange.Cells(1, 4) ' Adjust the column to match your Temp
column

HTH! And, by the way, I work at a hospital, so I am also used to searching
patient records!!!

"Ian" wrote:

I have a large spreadsheet (20,000 records) of patient records. I need to
search the records for specific patient IDs and then analyse certain fields
of data in the patient recordset but I'm not quite sure how to go about it.

I'd like to have some code/macro that opens a dialog box requesting my input
for a PatientID field. The code should then locate the relevant records if
that patient exists and if it does look at all the records matching that
PatientID and give me the lowest value of another field (Temp) in that group
of records for that patient.

At present I just use FIND from the menu bar then eyeball the data looking
for my lowest value, but it would be nice to have it automated.

I look forward to any suggestions,

TIA,

Ian.

  #3   Report Post  
Posted to microsoft.public.excel.programming
Ian Ian is offline
external usenet poster
 
Posts: 109
Default Search and Analyse

Thanks for the suggestions, that all seems to make sense except I'm a little
lost as to where the code should go, I'm more used to Access than Excel. I
tried putting a button on the worksheet with the code in the click event. I
got the dialog box but then an error: "Object variable or With block variable
not set" referring to the "MinTemp = " line. Sorry if I'm being thick!!

Ian.

"K Dales" wrote:

Can you sort the list of records? If so, I would suggest sorting by
PatientID first, then Temp 2nd, both ascending. Then finding the first line
for a given PatientID would automatically bring you to the line with the
lowest Temp. The code could be as simple as:

PatientID = InputBox("Enter the Patient ID:")
Set ResultRange = Range("A1:D7").Columns(1).Find(PatientID)
MinTemp = ResultRange.Cells(1, 4) ' Adjust the column to match your Temp
column

HTH! And, by the way, I work at a hospital, so I am also used to searching
patient records!!!

"Ian" wrote:

I have a large spreadsheet (20,000 records) of patient records. I need to
search the records for specific patient IDs and then analyse certain fields
of data in the patient recordset but I'm not quite sure how to go about it.

I'd like to have some code/macro that opens a dialog box requesting my input
for a PatientID field. The code should then locate the relevant records if
that patient exists and if it does look at all the records matching that
PatientID and give me the lowest value of another field (Temp) in that group
of records for that patient.

At present I just use FIND from the menu bar then eyeball the data looking
for my lowest value, but it would be nice to have it automated.

I look forward to any suggestions,

TIA,

Ian.

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
how do you use a chisquare function to analyse data mada Excel Worksheet Functions 1 May 10th 06 02:03 PM
how do I analyse two spreadsheets for missing data? [email protected] Excel Discussion (Misc queries) 2 March 31st 06 03:18 PM
How do i analyse visible rows only in excel? Dr Happy Excel Worksheet Functions 8 December 6th 05 05:13 PM
Need macro to analyse a column abrogard Excel Programming 3 June 13th 05 10:06 AM
vB code to analyse list scottwilsonx Excel Programming 2 June 30th 04 10:07 AM


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