+ Reply to Thread
Results 1 to 2 of 2

Excel 2010 - Userform - VBA How to stop ‘Job No’ from duplicating itself on next empty row

  1. #1
    Registered User
    Join Date
    09-07-2012
    Location
    Australia
    MS-Off Ver
    Excel 365
    Posts
    51

    Question Excel 2010 - Userform - VBA How to stop ‘Job No’ from duplicating itself on next empty row

    Hi there
    Thank you in advance for taking the time to check this out.

    Objective:
    To prevent duplication of incident numbers in the datasheet, and format the job number with a prefix of Inc- at the beginning. I currently have the cell customization set to “Inc”General but that only inserts the prefix in the cells on the datasheet, but is not showing in the disabled textbox in the userform.

    The Problem
    I have a ‘Job Number’ that is generated each time the form is opened and when the ‘Save’ button is clicked the data from the form is transferred over

    The job number is generated from the previous entry +1 (auto incrementing the old fashioned way).
    The problem arises when the ‘Save’ button is pressed repeatedly, the same job number and data is duplicated on the datasheet.

    Is there some way to ensure that the number generated is unique, and if the ‘Save’ button is repeatedly pressed that it will just over-ride the existing information?

    The number format currently used is 20150003 (incremented by 1). But what I’d like to be displayed in the form is Inc- 20150003

    Please Login or Register  to view this content.
    I’d be really grateful if someone could help me out, or perhaps direct me to where I might find some coding that will achieve the result I am seeking.

    I've attached a sample file so you will have an idea of how it currently works (or doesn't work)

    With much gratitude,
    TheShyButterfly

  2. #2
    Forum Contributor
    Join Date
    07-11-2012
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    144

    Re: Excel 2010 - Userform - VBA How to stop ‘Job No’ from duplicating itself on next empty

    Hi theshybutterfly,

    i have attached a modified code check if it is ok for you.

    i modified some events.

    1. When form is initialize save button will be disabled.
    2. When a person chose a category then only Save button will be enabled.
    3. After a person click save it will automatically disabled.

    check the attached 2015-03-30 -Security Incident Tracker - New V02-REVAMPED- sample.xlsm
    Ravikumar,

    * Please Add Reputation if solved.

+ 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] excel 2010 empty a cell according to other cells (without Deleting them just show empty)
    By pavlos_x in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-11-2015, 01:46 PM
  2. Duplicating non-empty rows
    By Bagana in forum Excel General
    Replies: 4
    Last Post: 11-01-2013, 09:03 AM
  3. How to stop info from duplicating on different sheets.
    By brandocalrissian in forum Excel General
    Replies: 0
    Last Post: 07-31-2012, 06:59 PM
  4. Replies: 2
    Last Post: 03-07-2006, 01:15 PM
  5. Stop from duplicating entries on multiptle sheets
    By Myhand in forum Excel General
    Replies: 1
    Last Post: 02-28-2006, 12:00 PM

Tags for this Thread

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