+ Reply to Thread
Results 1 to 2 of 2

Validate data in excel programmatically - new to VBA

Hybrid View

  1. #1
    Registered User
    Join Date
    06-06-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    1

    Validate data in excel programmatically - new to VBA

    I have external users doing data entry on an excel file.
    I've used data validation where I can, but cannot use VBA on the data entry file itself because end-users are restricted from using files with macros, and also use different versions of excel, etc.

    I find that users can copy/paste into a data-validated field and remove the data validation. I can fix this using VBA, but again, end-users cannot enable macros.

    I created a macro that takes data from the data entry file, and places it in an 'import' excel file (in which I can use VBA). Data in the 'import' excel file will be imported into Access.

    My question is, how do I validate the data in the 'import' excel file programmatically.
    For example, I have a customerID that can only be 9 characters long. If somehow the end-user was able to copy/paste an ID with less than or greater than 9 characters, I want my import file to tell me in which record this has occurred.

    Please help! And thanks!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,186

    Re: Validate data in excel programmatically - new to VBA

    For that particular example, you could either use a helper column or Conditional Formatting. Check LEN(...)<>9 and add a flag that you can use to filter or a CF colour.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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