+ Reply to Thread
Results 1 to 7 of 7

Conditional completion of blank cells

  1. #1
    Registered User
    Join Date
    10-09-2011
    Location
    UK
    MS-Off Ver
    Excel Mac 2011
    Posts
    10

    Conditional completion of blank cells

    Hello

    I am not sure how to ask this question.

    Using the example in the attached file. I want to go from the example in BICU SAMPLE to BICU SAMPLE-1

    I am working with a large dataset from a pathology database which has been exported to CSV then imported into Excel. There is no other way to format this data and I have to work with what I have.

    It is a microbiology database. Some patients will grow one organism from a particular site. I have called this Type in the example. But some patients with grow more than one organism, for example there are three Types in some of the example patients in the attached files.

    The database starts by putting each patient on a new row, then puts each type on a new row if there is more than one type per patient but only provides the demographic data once. So if a patient grows three organisms they will have a three row entry in the database, one for each organism, but only the first row will contain the demographic data.

    I need to copy the demographic data to each of the remaining rows but keep it identical to the original entry for that patient. So, for example, when I have tried to do this by dragging the bottom right corner it adds one to the unique number (which cannot change) and increases the date (again which cannot change).

    Usefully, every time there is a patient with more than one "Type" there is a blank row before the next patient. Most patients have grown only one "type" but some have grown two, three, four, five and even six organisms.

    I need an automated way to complete the missing demographic data. There is over 6000 results so it is impractical to do it by hand.

    Any suggestions would be very gratefully received.

    With my sincere thanks

    Ronan
    Attached Files Attached Files
    Last edited by bradfordicu; 10-09-2011 at 04:33 PM.

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Conditional completion of blank cells

    Hi Ronan,

    This should not be as difficult as you think, but just before I post a proposed response I do have a question: Why is there an empty row between George and John, but not Mary and John? Are you adding these empty rows yourself?

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    10-09-2011
    Location
    UK
    MS-Off Ver
    Excel Mac 2011
    Posts
    10

    Re: Conditional completion of blank cells

    Thank you.

    Where there is just one row per patient there is no blank row before the next patient. Where there is more than one row the dataset, for some reason, includes a blank row before the next patient.

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Conditional completion of blank cells

    Hi,

    This should do it.

    Please Login or Register  to view this content.
    Did you also want to delete those other rows that creep in the middle of the worksheet?

    abousetta

  5. #5
    Registered User
    Join Date
    10-09-2011
    Location
    UK
    MS-Off Ver
    Excel Mac 2011
    Posts
    10

    Re: Conditional completion of blank cells

    Yes, that would help, or at least make the data look neater.

    Sorry, I am a bit of a newbie with this. Can I just paste that code into Visual Basic Editor in Excel for Mac 2011?

    Thank you

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Conditional completion of blank cells

    Here's an updated version of the code:

    Please Login or Register  to view this content.
    It should delete the first row above the headers and the empty rows in between patients.

    About the mac issue, I am not sure as I don't use macs. I'm sure if you google it, the answer will not be hard to find.

    Let me know if you have any additional questions or concerns.

    abousetta

  7. #7
    Registered User
    Join Date
    10-09-2011
    Location
    UK
    MS-Off Ver
    Excel Mac 2011
    Posts
    10

    Re: Conditional completion of blank cells

    Thank you

    I will have a play with it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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