Consulting

Results 1 to 12 of 12

Thread: Challenging Macro

  1. #1
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location

    Challenging Macro

    Hi

    i not got a clue how to do this,,,totally lost

    Need a macro that will tell the user if they try and enter the same demand customer name that already exits in any worksheet that is visible in the workbook.......

    i.e. a message box. "Demand Customer is already included in the selected worksheet cannot add again" - warning message box.......

    if it is a new demand customer then proceed as normal...

    please find attached the workbook.....

  2. #2
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location
    apologies the macro has to be linked to the Add Supply macro button on the main worksheet....

  3. #3
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location
    apologies the macro has to function when the user clicks the Add Supply macro button,,,,,,All other function that the macro button does must remain........

  4. #4
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location
    polease ignore pervious workbook,,,,,,,find attached new workbook.....with minor changes

  5. #5
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    When I click on Add Supply the userform comes up.
    When I click on one of the on-the-fly Option Buttons, Excel locks up and I have to force quit. (There is no event code behind those buttons.)
    I don't see where the list of existing Demand Customers is stored.
    Are "USA", "Canada", etc. demand customers?

  6. #6
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location
    apologies try this workbook

  7. #7
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    What is a Demand Customer and where are they stored?

  8. #8
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location
    usa and canada are demand customer......where they are stored i do not know as the workbook was designed by some else.........

  9. #9
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location
    looking at the workbook....i believe that the userform read the demand and supply customer from the column the were add in originally A8 fro supply and H8 for demand customers....

  10. #10
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    It looks like Main Sheet!H:H holds the list of demand customers. Validation would prevent you from adding duplicates to that list.

    I suspect that part of the problem I'm having with the on-the-fly controls is that the project you posted is protected.

    How is the Add Supply userform supposed to work? What does pressing the OK button do?

  11. #11
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location
    Add userform.....you select and supply customer then on the opposite side you select a demand customer and post that demand customer into the supply customer workhsheet > press OK button...

  12. #12
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Seeing as the option buttons et al are added at run time, the code cannot know what is there so there is no code to react to anything.

    Why don't you start from scratch and say what you would like to do and throw away those forms?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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