+ Reply to Thread
Results 1 to 3 of 3

User form don't write if no data is entered

  1. #1
    Registered User
    Join Date
    10-06-2010
    Location
    Dunstable,England
    MS-Off Ver
    Excel 2010
    Posts
    95

    User form don't write if no data is entered

    Hi

    I have created this control panel in Excel vba and need some help to clean up the code and make it run more efficent.

    What I would like to add is an error trap that will produce a warning box advising the user thay haven't selected a week or site also currently the program will write the default values to the workbook. I would like to set it so that if the user enters nothing then nothing (not even a blank space) is written to the work book.
    Reason is that the user may only enter data for 1 day but the default data for all days is being written to the workbook which takes up unneccesary space.




    Goal - Would like to show an error if WeekDD and SiteDD default values have not been changed and if TextBox1 or TextBox2 default values have not been been changed nothing is to be written to the workbook.

    The TextBox default values are 0
    WeeDD Default value is week
    And SiteDD default value is Site

    Code I have so far is:


    Please Login or Register  to view this content.
    Can anyone offer some guidance on how to achieve this?

    I know I am asking lots of questions but I am new to creating forms in VBA. many thanks in advance.
    Last edited by nods; 11-11-2010 at 12:37 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: User form don't write if no data is eneterd

    I would loop through the controls to check the settings, but it's hard to say what needs doing without seeing the form
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    10-06-2010
    Location
    Dunstable,England
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: User form don't write if no data is entered

    this was solved with

    Please Login or Register  to view this content.

+ 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