+ Reply to Thread
Results 1 to 6 of 6

Userform only to input data to Sheet only if textbox contains data/number.

  1. #1
    Forum Contributor
    Join Date
    01-06-2012
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    165

    Userform only to input data to Sheet only if textbox contains data/number.

    I'll try to put this in the best way I can;

    I have a multipage userform with four sets of textboxes (codenamed SWS,SWL,DWS,DWL). Each 'set' of textboxes will enter inputted values in a new row in sheet 2. Here's an example:

    Please Login or Register  to view this content.
    What happens is I get 4 rows of data sent to Sheet2. However, often there will be no data inputted into some sets (eg SWS), and there will be a blank row of data in Sheet2. Is there any way around this? IE only send through the sets of data if there are values inputted.
    Last edited by BPSJACK; 08-31-2012 at 11:31 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Userform only to input data to Sheet only if textbox contains data/number.

    Can you post an example of your workbook?

    Thanks!

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Userform only to input data to Sheet only if textbox contains data/number.

    BPSJACK,

    Give this code a try:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Contributor
    Join Date
    01-06-2012
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    165

    Re: Userform only to input data to Sheet only if textbox contains data/number.

    Here's an example workbook.
    Attached Files Attached Files

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Userform only to input data to Sheet only if textbox contains data/number.

    Updated code based on example file:
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    01-06-2012
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    165

    Re: Userform only to input data to Sheet only if textbox contains data/number.

    That is brilliant I'd never thought of that! Thankyou!

+ 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