Multiple Criteria From Differing Rows

  • Re: Multiple Criteria From Differing Rows


    Quote from psindelar

    Bill,
    That worked beautifully! Now, what is the best way for me to learn VBA? Book or class?


    Hi Patty. If you can find a course on VBA then that will wet your appetite and get you started. But I'd have to say a good book will do equally as well as any course. Then the forums will really start to advance your progress as you've got access to answers to problems that are specific to your needs.


    So to answer your question...all 3: Books and forums...and if you can find one with substance, a course but I wouldn't be too worried about doing a course.


    Brad

    Brad.

  • Re: Multiple Criteria From Differing Rows


    Bill,


    Replace


    [vba]If a(i, 8) = z(j)(1) And b(i, 2) = z(j)(2) Then[/vba]


    with


    [vba]If a(i, 8) = z(j)(2) And b(i, 2) = z(j)(1) Then[/vba]


    I think your find method is better here because of partial match of course name.

  • Re: Multiple Criteria From Differing Rows



    change

    Code
    .Pattern = "I+$"

    to

    Code
    .Pattern = "\D+$"
  • Re: Multiple Criteria From Differing Rows


    jindon,
    Still get error 5 Invalid Processing Call


    Krishnakumar,
    Your result matched mine except
    1. No 3’s for the last course set in the test data, Marketing/Retail Marketing
    2. You found a match in Bus Comp Apps I and II that I did not. You are keying on column A. I keyed on the break of 1 and 2 in columns I and J.


    Patty,


    I think there is a data problem as Bus Comp Apps I is labeled both with 1’s and 2’s in the test data you sent (rows 287 through 315). Is your live data OK.


    Bill

    [FONT="Arial Black"][COLOR="blue"][SIZE="4"]Bill[/SIZE][/COLOR][/FONT]
    Tip: To avoid chasing code always use Option Explicit.

  • Re: Multiple Criteria From Differing Rows


    Patty,


    If the course numbers are suppose to be uniquely labeled with either a 1 or a 2 then you have some data integrity issues with the test data you sent. If that is the case then this program will spot courses not labeled properly.



    Bill

    [FONT="Arial Black"][COLOR="blue"][SIZE="4"]Bill[/SIZE][/COLOR][/FONT]
    Tip: To avoid chasing code always use Option Explicit.

  • Re: Multiple Criteria From Differing Rows


    All the people that have contributed to this thread have done a fantastic job.


    I do think that the database that holds this information needs to be looked at by the database administrator to possibly have another field added like "parent course".


    This would make the data a lot easier to manipulate within a spreadsheet and also the database holding the info.

    For example:

    Code
    [B]Dept	Course	Course Name	[COLOR="SeaGreen"]Parent Course[/COLOR]	Sec	Course Length	Credits	Student ID	S1	S2	FY[/B]
    BUS	3502	Formatting II	[COLOR="SeaGreen"]Formatting I[/COLOR]	1	Semester	5	270144		1


    Or something along those lines.


    Brad.

    Brad.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!