Hi there, I'm new to Macros/VBA and to this forum too so I would be grateful if people could use language that I would understand!
I have a database of about 6000 patients with their details (name, DOB etc.) and their diagnoses (Addisons, Turners etc,). These diagnoses come under the umbrella of the organ they are associated with. For example, Addisons is a problem with the adrenal gland and Turners is a problem with the ovaries. Some patients have multiple diagnoses with one organ, or even multiple diagnoses with multiple organs.
My job is to create new sheets from this 'master sheet' containing only patients with adrenal problems in one sheet and only patients with ovary problems in another and so on and so forth for each organ. It is also important that patients who have problems in multiple organs appear in each respective sheet. E.g. a person with adrenal issues appears in the adrenal sheet and if they have ovary issues they also appear in the ovary sheet.
I've attached an excerpt from the database and for obvious reasons I have replaced the confidential information. If you notice, not all of the columns are full, which I hope ought not to be an issue and also some patients which are a work in progress don't have a diagnosis and as such they are labelled with an 'X' in the first diagnosis column. Moreover, some patients will not have a diagnosis and will be labelled with the tags UNDIAGNOSED and/or DISCHARGED.
Basically I need to copy whole rows containing the word 'ADRENAL' into the sheet labelled 'Adrenal.' And again with the other organs as well. It's important that the whole row containing all of the patient information is copied along with the diagnoses.
I imagine that I would need a macro for each organ....but I literally don't know anything about macros/VBA so I shall stop guessing!
I have attempted to read other threads but I find it all very confusing, hopefully by talking about my example specifically I will get it.
Sorry for the long message but I wanted to be thorough and hopefully I have been. Reply if any other information is required. I will endeavour to reply ASAP but as I'm sure you can imagine, doctors don't get a lot of free time!
Kind Regards
P.S. I forgot to mention that ideally the codes would also work for future data being entered as I intend on expanding the database.
Template Original.xlsx
Bookmarks