+ Reply to Thread
Results 1 to 10 of 10

Userform textbox code

  1. #1
    Forum Contributor
    Join Date
    12-16-2004
    Posts
    125

    Userform textbox code

    I have a userform and I want a textbox that counts cells J7,M7,P7,S7,V7. Does anyone know how to write this code and where to put it. All I want is the textbox to show how many cells of these five have data in them and I want it to update automatically.

    Thanks for any help.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    This will show how many cells contain data in the range, don't know what you mean by update automatically

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    12-16-2004
    Posts
    125
    Thanks for the reply. That works, but with one problem. I need this to update in real time. This only updates when the userform is opened. Is there a way to update this anytime the data changes?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    How can you change the cells with the userform open, unless it is modeless.

  5. #5
    Forum Contributor
    Join Date
    12-16-2004
    Posts
    125
    The userform itself changes the cells. Each time I press a button on the userform, the cells update. I need the textbox to update each time the cells update.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Just add this to the end of your button's code

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-16-2004
    Posts
    125
    That works great, but I have one more question. Is there any way to show blank instead of 0 when the cells are empty?

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    The code only needs slight modification

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    12-16-2004
    Posts
    125
    That works perfect. Yet again this forum has bailed me out when I couldn't. Thanks a bunch.

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Glad we helped, pleaqse mark the thread solved

+ 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