+ Reply to Thread
Results 1 to 6 of 6

backcolor for multiple textboxes

  1. #1
    Registered User
    Join Date
    06-02-2014
    Posts
    88

    backcolor for multiple textboxes

    Hi,
    I have produced a userform with multiple textboxes.
    How should I provide with general code to textboxes.backcolor only for empty texboxes?

    Regards,
    M

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: backcolor for multiple textboxes

    You may try something like this....

    Place the following code on Form Module.

    Please Login or Register  to view this content.
    And then Call it from the desired command button like this.....

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Registered User
    Join Date
    06-02-2014
    Posts
    88

    Re: backcolor for multiple textboxes

    Almost works, the only problem is:
    Compile error: Invalid use of me keyword

    Any alternative?

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: backcolor for multiple textboxes

    How does it almost work if you get a compile error?

    Did you place the code on Form Module?

  5. #5
    Registered User
    Join Date
    06-02-2014
    Posts
    88

    Re: backcolor for multiple textboxes

    Yes, it is pasted to module form.

    I tried to call this code couple of times and twice it worked, this is what I meant saying ALMOST WORKS

    When I close userform, then error occurs...

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: backcolor for multiple textboxes

    If the code worked twice that means there is nothing wrong in the code. The problem is somewhere else. I don't know how this code is connected with form close event. Maybe you know better.

+ 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] Sum the contents of multiple Textboxes in VBA
    By Stressed_Daniel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-30-2015, 12:48 PM
  2. Replies: 0
    Last Post: 02-04-2015, 03:46 PM
  3. Code for a master command button to change the backcolor of multiple command buttons?
    By panttherm5 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2012, 10:11 PM
  4. TextBoxes backcolor as cells color
    By john55 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-26-2011, 12:53 PM
  5. Disabling multiple textboxes
    By austin350s10 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2011, 03:59 PM
  6. Change Textbox Backcolor (multiple textboxes)
    By msommerf in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2010, 10:52 AM
  7. [SOLVED] Loading Multiple TextBoxes
    By Hambone in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2006, 03:29 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