+ Reply to Thread
Results 1 to 3 of 3

Need some help for validation in a macro

  1. #1
    Registered User
    Join Date
    08-11-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    22

    Need some help for validation in a macro

    i am very new to VBA and currently working on a macro buy got stuck with some issue .

    My macro details are as below

    Under macro i have create a form by which an worker would enter his
    daily production unit and this data would be save in another excel
    file named database. I am done with saving the data to that excel file
    but stuck on some validation.

    Please help me on these validation.

    Date Validation

    1. Under date text box - date format (mm/dd/yyyy) can be enter only
    and does not allow to enter future date.

    2. On submit click , it validate that unique record saved in database
    file on the basis of Name and date.

    3. On submit button , none of text box value remain blank, if so then
    give error.

    4. I want save data month wise, means whenever new month start it
    automatically save data on new tab (worksheet) and name that tab with
    name.

    Please help me with this, i have attached the my macro file.
    Attached Files Attached Files

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Need some help for validation in a macro

    Maybe Project_Validation.zip
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    08-11-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Need some help for validation in a macro

    Thank you Solus for your urgent help on this.

    But can you please help me further , as it still not fulfilling my requirement. Please find my full requirement below

    1 . Can we use the Date picker tool instead of text box so that user can pick right date. Further i also want to put validation on that user can't choose any future date (means date greater then today).

    2. Data is still saving on same sheet for all months, i want if any user enter data for new month it create the new tab with that month name and save the data of that month into that month tab.

    User Jan data goes in Jan tab of sheet, and Feb data on fab tab same way for all months on the basis of user date selection

    3. It still accepting the duplicate records, i try to put various validation for preventing duplicate record entry on the basis of user and date but it doesn't work . So please help with this as well. In this if any user enter the data for same date which already exist on his name in database file then he got error of duplicate record and he can't enter the data of that date again.


    Thanks Again for your help on this. Mentor like you always help us learn to something new.

+ 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. Data Validation Macro within Macro
    By mil_tech in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-09-2013, 01:51 PM
  2. Validation through Macro
    By Nithya1987 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-31-2012, 01:35 PM
  3. Stop Worksheet_Change macro if validation not met in Data Validation
    By Wizz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-20-2010, 12:26 PM
  4. macro for validation
    By mvalco in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-09-2009, 01:04 PM
  5. macro validation
    By villan_1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-10-2007, 01:15 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