+ Reply to Thread
Results 1 to 3 of 3

Multiple Identical UserForms

  1. #1
    Craig
    Guest

    Multiple Identical UserForms

    Hi there, I have nine identical userfoms that each contain over 100 mixed
    controls. Each UserForm has it's own name (frmTicket1, frmTicket2,
    frmTicket3..... to frmTicket9). There are procedures which are located
    within the UserForms code area with identical procedures with the same names
    within each UserForm. The references to the worksheets are different but the
    control references are the same. What I would like to know is it best
    practice to rename all the controls on each userform, so I don't have any
    controls or procedure with the same names? This would be a tedious job. If
    so, is there an easier way to change these control names at design time
    without having to click on each control and type in a new name? Any
    reference to a control is done by using the userform name first
    (frmTicket1.txtBox1.Text=
    I was just thinking that if I don't need to change all these names... I'm
    wasting my time.

    Could someone enlighten me on what the best practice in this situation is?

    Thanks Craig



  2. #2
    Tom Ogilvy
    Guest

    Re: Multiple Identical UserForms

    You shouldn't need to change the names.

    If the only difference in the forms, is the sheet name they reference, it
    probably would be easier to have one userform and put in some case
    statements in the code or set a variable to the sheet name and use the
    variable everywhere else.

    --
    Regards,
    Tom Ogilvy


    "Craig" <[email protected]> wrote in message
    news:WxRdf.498381$1i.150864@pd7tw2no...
    > Hi there, I have nine identical userfoms that each contain over 100 mixed
    > controls. Each UserForm has it's own name (frmTicket1, frmTicket2,
    > frmTicket3..... to frmTicket9). There are procedures which are located
    > within the UserForms code area with identical procedures with the same

    names
    > within each UserForm. The references to the worksheets are different but

    the
    > control references are the same. What I would like to know is it best
    > practice to rename all the controls on each userform, so I don't have any
    > controls or procedure with the same names? This would be a tedious job. If
    > so, is there an easier way to change these control names at design time
    > without having to click on each control and type in a new name? Any
    > reference to a control is done by using the userform name first
    > (frmTicket1.txtBox1.Text=
    > I was just thinking that if I don't need to change all these names... I'm
    > wasting my time.
    >
    > Could someone enlighten me on what the best practice in this situation is?
    >
    > Thanks Craig
    >
    >




  3. #3
    Craig
    Guest

    Re: Multiple Identical UserForms

    Thanks Tom... I now have one userform and setup variable for the sheet range
    references!
    Thanks again for helping me out... I should have thought of that, have done
    it before. Got mixed up and wasn't thinking clearly!
    Thanks Again
    Craig

    "Tom Ogilvy" <[email protected]> wrote in message
    news:[email protected]...
    > You shouldn't need to change the names.
    >
    > If the only difference in the forms, is the sheet name they reference, it
    > probably would be easier to have one userform and put in some case
    > statements in the code or set a variable to the sheet name and use the
    > variable everywhere else.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Craig" <[email protected]> wrote in message
    > news:WxRdf.498381$1i.150864@pd7tw2no...
    >> Hi there, I have nine identical userfoms that each contain over 100 mixed
    >> controls. Each UserForm has it's own name (frmTicket1, frmTicket2,
    >> frmTicket3..... to frmTicket9). There are procedures which are located
    >> within the UserForms code area with identical procedures with the same

    > names
    >> within each UserForm. The references to the worksheets are different but

    > the
    >> control references are the same. What I would like to know is it best
    >> practice to rename all the controls on each userform, so I don't have any
    >> controls or procedure with the same names? This would be a tedious job.
    >> If
    >> so, is there an easier way to change these control names at design time
    >> without having to click on each control and type in a new name? Any
    >> reference to a control is done by using the userform name first
    >> (frmTicket1.txtBox1.Text=
    >> I was just thinking that if I don't need to change all these names... I'm
    >> wasting my time.
    >>
    >> Could someone enlighten me on what the best practice in this situation
    >> is?
    >>
    >> Thanks Craig
    >>
    >>

    >
    >




+ 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