+ Reply to Thread
Results 1 to 7 of 7

VBA FORM add MISSING to empty cell

  1. #1
    Registered User
    Join Date
    09-11-2019
    Location
    Canada
    MS-Off Ver
    2010, Excel 365
    Posts
    27

    VBA FORM add MISSING to empty cell

    Hello all,

    I would greatly appreciate any help on this problem, as follows; I have created a VBA form with a lot of entries and the form works great, the user enters data into the cells and after pressing enter the data loads into the the spreadsheet, after entering the next set of data the next row is selected and the data is entered into the row, so far all good,

    so what I would like to do now is if a particular cell of the form lets say orientations has not been entered (as it might not have happened as yet) and has been left blank for future use, then a formula to input into the blank cell "MISSING" so that it does not get forgotten about.

    I had a formula entered into a cell as follows; =IF(ISNUMBER(SEARCH("*",$A$6)),$BQ$6,"") it looks to see if there is any text in A6 if there is no text then it looks to another cell that has "MISSING" which it then enters (this formula was copied down the column by hand) all seemed to work fine until another entry is done by the 'form' to which it left the cells blank and either overwrote or deleted the formula,

    I have even tried using conditional formatting and cant get the formula to work, I have tried to up load my spreadsheet but for some reason it wont upload? probably to big or im doing something wrong, so I have just entered a very short sample and also the VBA code below, so either a formula taht I can use in the VBA FORM or a formula that I can use on the spreadsheet itself that will not be written over unless its the actual date that is being entered into..............again thanks in advance for any help or advice, it is very much appreciated.


    =======================================================================================================================

    A B C D E F G
    1 EMPLOYEE NAME | EMPLOYEE ID | AREA | JOB TITLE | GLOBAL ORIENTAION | WHIMS | ORIENTATIONS |
    2 --------------------------------------------------------------------------------------------------------------------------------------
    3 JOHN DOE 123456 LEVEL 1 CLEANER 2022-01-23 2022-02-02 2022-03-02
    4 JOE BLOGGS 234567 LEVEL 2 ADMIN MISSING MISSING MISSING
    5 PAUL MAUL 345678 LEVEL 3 TRAINER 2022-03-04 2022-03-06 2022-05-27
    6 DAVE RAVE 456789 LEVEL 4 SUPERVISOR ETC
    7 STEVE REEVE 567890 LEVEL 5 HELPER

    VBA CODE
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by Paul; 07-26-2022 at 06:16 PM. Reason: Added CODE tags

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,918

    Re: VBA FORM add MISSING to empty cell

    I think it would be easier to help with a solution if we could see it in context. Could you upload the file? Use dummy data rather than any real life sensitive data.

    BSB

  3. #3
    Registered User
    Join Date
    09-11-2019
    Location
    Canada
    MS-Off Ver
    2010, Excel 365
    Posts
    27

    Re: VBA FORM add MISSING to empty cell


  4. #4
    Registered User
    Join Date
    09-11-2019
    Location
    Canada
    MS-Off Ver
    2010, Excel 365
    Posts
    27

    Re: VBA FORM add MISSING to empty cell

    hopefully my file has been uploaded?
    Attached Files Attached Files

  5. #5
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,918

    Re: VBA FORM add MISSING to empty cell

    One way to deal with this would be replacing lines that stamp data to the sheet, like this:
    Please Login or Register  to view this content.
    With something like this:
    Please Login or Register  to view this content.
    I've used TRIM so that if the user just puts a space character in the field it will still stamp missing.

    Note, you don't often need to use .Value when stamping data to the sheet. In fact, I only ever use it if I'm stamping numeric values like numbers, dates, times.

    BSB

  6. #6
    Registered User
    Join Date
    09-11-2019
    Location
    Canada
    MS-Off Ver
    2010, Excel 365
    Posts
    27

    Re: VBA FORM add MISSING to empty cell

    sorry for the mix up of uploading the example spreadsheet, I guess the site was doing maintenance at the time. Sir your code works perfectly thank you for taking the time to create the code and reply, you are a gentleman and a scholar. thanks again your help is very much appreciated.

  7. #7
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,918

    Re: VBA FORM add MISSING to empty cell

    Very glad I could help.

    Good luck with the rest of the project and let us know if you need more help.

    BSB

+ 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. Replies: 2
    Last Post: 06-01-2022, 12:18 PM
  2. How to bring value form cell A if cell C is empty while doing (A2+B2)*C2
    By Altamija in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 02-03-2019, 10:29 AM
  3. [SOLVED] Displaying empty cells and not #N/A when missing information in a formula
    By Julez80s in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-25-2012, 11:13 PM
  4. Empty cell Validation on Form
    By excelit in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 04-14-2011, 06:57 PM
  5. Add empty Row for Missing data
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2010, 08:05 PM
  6. Go to next empty cell then add data using form
    By hackersarchangel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-29-2010, 04:38 AM
  7. Excel 2007 : Charting missing data: empty cells bug
    By kazim in forum Excel General
    Replies: 8
    Last Post: 10-26-2009, 08:18 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