+ Reply to Thread
Results 1 to 2 of 2

I need a macro that will pull out a patient's details from different sheet

  1. #1
    Registered User
    Join Date
    12-14-2013
    Location
    edo,nigeria
    MS-Off Ver
    Excel 2007
    Posts
    85

    I need a macro that will pull out a patient's details from different sheet

    Hello guys. I have a worksheet with details of patients in different sheets. There are sheets44 like malaria, diabetes, HIV,admissions where details of patients (like name and date) who suffer from the sicknesses are stored. A patient can suffer from more than one sickness. Each patient has a unique file number. I need a macro that will fish out the patient's details from each of the sheets, stating the sheet where each file number were found and the date recorded against the patient in each of the sheets. for example, A file number 12345 belonging to a patient, Mathew Greg was found in sheets: malaria and diabetes. When I search for 12345, I want the following result to be displayed.

    file number: 12345
    Malaria: 3/7/2015 (as recorded against his name in the sheet)
    Diabetes: 4/7/2015 (as recorded against his name in the sheet)
    These information may be displayed in a userform or in any convenient style

    Is it possible that these information be transferred to another sheet named "folder" ? when a button is clicked?
    Attached is the workbook

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: I need a macro that will pull out a patient's details from different sheet

    You are making the same mistake that I see time and time again. You are mixing up the two elements of data capture and final reporting. The two require quite different treatments.

    A lot of people start by designing the forms/sheets that they expect to see as the final report, and then wonder why it's so difficult to subsequently analyse and summarise or extract information from it, Yours exhibits all those features.


    You should always capture data in a simple two dimensional table and worry about reporting information from it afterwards. Without exception doing this you will always be able to easily obtain management information. Rarely is this the case if you start the other way round.
    You will also throw open the whole wonderful world of the powerful Pivot table functionality.

    I would urge you to combine all your patients records into a single straightforward two dimensional table. This will no doubt include all your existing column labels (and I'm assuming all patients' sheets are the same layout) with an additional column for file number. Each row would be a unique piece of information.

    Once you have that your requirement is simplified immensely.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 04-30-2015, 12:19 AM
  2. Replies: 5
    Last Post: 04-28-2015, 10:38 PM
  3. [SOLVED] Macro to prepare Database from Shipment Details Sheet
    By prkhan56 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-12-2014, 03:24 PM
  4. Macro copy details from certain cells on one sheet to another
    By rjm87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2013, 10:31 PM
  5. Replies: 5
    Last Post: 11-02-2012, 03:08 AM
  6. How do i pull details from a table to appear as a list in excel?
    By GBH99 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-29-2005, 06:55 AM
  7. Replies: 0
    Last Post: 01-04-2005, 10:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1