+ Reply to Thread
Results 1 to 6 of 6

Combine data from multiple sheets with conditions

Hybrid View

  1. #1
    Registered User
    Join Date
    08-01-2012
    Location
    London,England
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Combine data from multiple sheets with conditions

    Quote Originally Posted by stnkynts View Post
    Attachment 202592

    The reason no one has replied is probably due to the amount of work that is required to solve your problem. I have attached an updated copy of your workbook. Rather than trying to figure out what you had going on with the command buttons in your userform I just created a new button called test. I think I have it doing what you want it to. If it does then you can add it to where you need it.
    I just realised, if there is a way to modify your code to delete the unwanted records created on Excel SheetPage:1,2&3. Some records are created where the only information they have patient name & patient ID under columns 1 &2, and a default date in column 11, while the remaining cells in that row are blank. This happens on all sheets ( I know why it happens, that's why I want something that deletes this from all sheets or at least the 'Consolidated' sheet)
    Last edited by luckyk; 12-27-2012 at 09:26 PM.

  2. #2
    Registered User
    Join Date
    08-01-2012
    Location
    London,England
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Combine data from multiple sheets with conditions

    Hello stnkynts
    I may have resolved my problem. What I have done is instead of adding a new command button. I used an extra code for the 'Submit' button command. The 'Submit' command was programmed to store the data from the Userform (Page1, Page2 & Page 3) to their respective excel sheet. What I did different now was create an If Else statement and add new 'Set WS = Sheets ("Consolidated") , giving some conditions around DtPicker values.(e.g Set ws = Sheets("Consolidated")
    If Me.DTPickerV1.Value > 0 Then
    ws.Cells(iRow, 2).Value = Me.TxtPtNmbr.Value
    ws.Cells(iRow, 3).Value = Me.CmBXNewMole.Value
    ws.Cells(iRow, 4).Value = Me.CmBxClinSusp.Value...... and so on)
    So now what it does is,
    1. Does not write the unwanted data
    2. Simulatneously also submit data from each multi-page to the consolidated sheet

    Let me know what you think

+ 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