Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jun 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro triggered by target cells (Excel 2000)

    Hello Lounge,

    Wondering if someone could take a look and offer some help to some code which seems to be missing something to make it work.

    What I am tring to do is have a personal sheet which can be easily updated.

    on another sheet have a form that is filled in.
    e.
    in on sheet Dispatch col.H15 type the initials of an employ and they should automatically be filled in or propmted to pick the individual.

    I have perfected this with Call taken by, Supervisor and employee name 1 but employee name 2 is not working and I cant fiqure out where I am going wrong.


    If Target.Row < [DispatchEmployeeNameHdr].Row + 1 Then Exit Sub
    If Target.Column <> [DispatchEmployeeNameHdr].Column Then Exit Sub
    DealWithChosenCell (Target.Range("A1").Address)
    If Target.Row < [Dispatchemployeenamehdr2].Row + 1 Then Exit Sub
    If Target.Column <> [Dispatchemployeenamehdr2].Column Then Exit Sub
    DealWithChosenCell (Target.Range("A1").Address)

    is the logic that fills in Emplyee 1 rows and employee 2 rows. It seem that the code never makes it to the Dispatchemployeenamehdr2 part.

    Any suggestion or ways I can do this whole process easier??

    Thanks for your time

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro triggered by target cells (Excel 2000)

    DispatchEmployeeNameHdr is F23, and DispatchEmployeeNameHdr2 is K23, so both have the same row. If the user is not in column F (the column of DispatchEmployeeNameHdr), the line

    If Target.Column <> [DispatchEmployeeNameHdr].Column Then Exit Sub

    will exit the event procedure, so the rest of the code will only be executed if the user is in column F, but then the column obviously is NOT K. Try this instead

    Select Case Target.Column
    Case [DispatchEmployeeNameHdr].Column, [DispatchEmployeeNameHdr2].Column
    DealWithChosenCell Target.Range("A1").Address
    End Select

  3. #3
    New Lounger
    Join Date
    Jun 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro triggered by target cells (Excel 2000)

    Hi hans, Thanks for the method. I am going to learn this Case function you used.

    Is there an easier for me to do what this accomplises? The macro is quite large. Maybe someone has done this with simple code??

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro triggered by target cells (Excel 2000)

    If it works, why bother?

Posting Permissions

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