+ Reply to Thread
Results 1 to 3 of 3

Code for all TextBoxes; Comboboxes and CheckBoxes in an UserForm

  1. #1
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Code for all TextBoxes; Comboboxes and CheckBoxes in an UserForm

    Dear all,
    I trust you're well.
    I have a code for an event when user chooses a reference from a ComboBox it populates data from sheet to TextBoxes and ComboBoxes in a UserForm which is working well.
    Need all TextBoxes; Comboboxes and CheckBoxes Locked and not enabled.
    So far, I have the following code but the issue is that's too long:

    Please Login or Register  to view this content.
    I am trying to reduce the code so I don't have to type all Boxes reference as I have over 30 of them.
    I tried to use the following but it is not working and no error messages are shown:

    Please Login or Register  to view this content.
    Any ideas and suggestions will be highly appreciated.
    Many thnks in advance and kind regards,
    Filipe

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Code for all TextBoxes; Comboboxes and CheckBoxes in an UserForm

    Hi,

    The TypeName cannot match all three items at one time- you should use Or rather than And
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Re: Code for all TextBoxes; Comboboxes and CheckBoxes in an UserForm

    Hi xlnitwit,
    That's it. I should have used the "OR" instead of "AND".
    Worked like a charm.
    Thanks a million for your assistance.
    Really appreciated.
    Best regards,
    Filipe

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Userform Command Button to add more comboboxes and textboxes at the same time
    By charscribbles in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-29-2014, 12:35 PM
  2. Help Needed - Userform Dates, Checkboxes and Reliant Comboboxes
    By SEMGoddard in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-01-2014, 07:49 AM
  3. SetFocus doesn't work properly on a Userform on ComboBoxes and TextBoxes
    By pimre in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-15-2013, 03:15 PM
  4. UserForm, TextBoxes/ComboBoxes & Typing Control Error
    By wipMan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-25-2013, 07:52 AM
  5. userform with 3 comboboxes and textboxes send to sheet
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-15-2013, 03:15 PM
  6. Data Validation for all TextBoxes and Comboboxes in Userform
    By singhabhijitkumar in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-12-2010, 05:48 PM
  7. How to empty all comboboxes and textboxes in a userform
    By LoveCandle in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-06-2009, 02:28 AM

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