+ Reply to Thread
Results 1 to 6 of 6

Disable TextBoxes and imput the correct data Based on ComboBox Choice

  1. #1
    Registered User
    Join Date
    12-13-2009
    Location
    Lisbon,Portugal
    MS-Off Ver
    Excel 2003
    Posts
    56

    Disable TextBoxes and imput the correct data Based on ComboBox Choice

    Hi all,

    when i choose material from my combobox Options (cboTM), i wanted, only the textboxes regarding to the sheet material unlocked, and the others locked with the color of the form, and the same for the other options like worklabor and equipments. i could blocked for material with this code :



    Please Login or Register  to view this content.
    the prob is , worklabor and equipments will be blocked too, and i dont know how to put the correct info on the textboxes
    Attached Files Attached Files
    Last edited by Nuno Neves; 03-29-2014 at 07:18 AM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Disable TextBoxes and imput the correct data Based on ComboBox Choice

    Try something like this. I don't know what textboxes you want enabled for worklabor and equipments.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    12-13-2009
    Location
    Lisbon,Portugal
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Disable TextBoxes and imput the correct data Based on ComboBox Choice

    For materials all worked well

    for Worklabor and equipments,(after i changed the required texboxes to false) only the opaque didnt worked


    the other thing was, how i put the correct info on the texboxes :



    if i choose "materials" from cboTM, and option 1 ("B7") from cboDM, textemp and textHours will become blocked :

    (sheet Material)

    textmeasure ="C7"
    textQuant="D7"
    textprice="E7"
    texttprice="F7"


    same to Worklabor :

    if i choose "worklabor" from cboTM, and option 1 ("B7") from cboDM, textQuant will become blocked :

    (sheet Worklabor)

    textmeasure ="C7"
    textemp="D7"
    textHours="E7"
    textprice="F7"
    texttprice="G7"


    and the same for Equipents....etc..

    i attached my file with the alterations
    Attached Files Attached Files
    Last edited by Nuno Neves; 03-24-2014 at 02:26 PM.

  4. #4
    Registered User
    Join Date
    12-13-2009
    Location
    Lisbon,Portugal
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Disable TextBoxes and imput the correct data Based on ComboBox Choice

    i could solve almost my main issue. however i found 2 problems.

    1) the data that is displayed on the textboxes named "textprice" and "texttprice" are formated as currency, but in both textboxes and cells they are formated as currency.

    2) for one sheet i could get the info onall textboxes. But for the other sheet, i am getting error, i believe is because exist a conflict with the textboxes that are the same for the 3 sheets i am using. dont know how to solve this.

    my code :

    Please Login or Register  to view this content.


    i attached my file too, to help better understanding.

    Thks in advance.
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Disable TextBoxes and imput the correct data Based on ComboBox Choice

    You're welcome.

    Moved the cboTM_Exit code to the cboTM_Click procedure. Delete cboTM_Exit.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-13-2009
    Location
    Lisbon,Portugal
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Disable TextBoxes and imput the correct data Based on ComboBox Choice

    Perfect

    Now i see the noobish i was doing, using the match funcion instead the offset. At the time i didnt understood the offset. But now i can see how simple is.
    so simple and fluid the code become
    Its by valuabe contributors like you,that noobs like me evolve learning with the bests.

    Thks you very much.

+ 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. Replies: 7
    Last Post: 03-24-2014, 09:12 AM
  2. Replies: 2
    Last Post: 03-23-2014, 08:11 PM
  3. Populating textboxes based on ComboBox value.....
    By harish_gr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2013, 09:05 AM
  4. Disable textboxes if Combobox is not selected first
    By puuts in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-27-2013, 10:58 AM
  5. Linking to Outlook Contact Information based on Combobox Choice
    By Nick_P in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-06-2012, 02:28 PM

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