How to combine two codes

  • Hi


    Just had a quick look at your test file ...

    Working with Text in UserForms can be tricky for dates ...


    Your Dateserial function does requires Numbers to work properly ... and very probably your inputs in your different ComboBoxes are simply Text ... which would need to be converted to Numbers with CInt() or CLng() ....


    You could test following modification

    Code
    dt1 = DateSerial(CLng(ComboBox2.Value), CLng(ComboBox3.Value), CLng(ComboBox4.Value))
    dt2 = DateSerial(CLng(ComboBox5.Value), CLng(ComboBox6.Value), CLng(ComboBox7.Value))

    Hope this will help

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • After trying, still no way ...THANK YOU

  • hello expert

    UserForm2 works fine

    My UserForm1+UserForm2 is group together

    will go wrong

    merge like userfrom1 code

    test2.xls




    Hi again,


    Just tested with your file ... and your UserForm2 is working fine ;)


    See attached file

  • Carim

    Added the Label Cross Post
  • First of all CROSSPOST ... :thumbdown:


    As reported by Fluff13 2 hours ago    mrexcel.com/board/threads/vba-…ombine-two-codes.1224379/


    Thanks Fluff13


    Please read Forum Rules: Forum Rules


    Sorry but cannot manage to understand what you are saying ....

    since the only spot ( within all of your whole workbook ) where you are using Dates is the one discussed above ...

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

    Edited 2 times, last by Carim ().

Participate now!

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