+ Reply to Thread
Results 1 to 5 of 5

Check cells are correct format and contain correct data

  1. #1
    Registered User
    Join Date
    01-26-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    2

    Check cells are correct format and contain correct data

    Hi

    We receive about 20 sales files of several hundred lines of data each day from various agencies. I want to create a macro / VBA code which checks that the data submitted is correct so that we can upload it into our database without import errors and / or having to manually check each line of data.

    I envisage something like an output report:

    #####################

    149 entries
    Column A - Date - OK
    Column B - Customer_Phone - Errors (Should be 11 digits)
    Row 21 - Customer_Phone - Error (Not 11 digits)
    Row 108 - Customer_Phone - Error (Contains letters)
    Column C - Outcome - OK

    Please correct and re-check.

    #####################

    Can someone point me in the right direction? I'm looking for pointers so that I can solve myself.

    Thanks

    rik

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Check cells are correct format and contain correct data

    Try this:

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Check cells are correct format and contain correct data

    Correction to first code. Missed the test for alpha

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-26-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Check cells are correct format and contain correct data

    Thanks alansidman

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Check cells are correct format and contain correct data

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. need correct formula to determine which cells to format
    By regional1500 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-19-2013, 12:22 AM
  2. Replies: 4
    Last Post: 03-21-2013, 11:35 AM
  3. Userform to check Date/Time format correct before copying to worksheet
    By LoneWolf3574 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-16-2013, 05:14 AM
  4. Fix Needed for Code to Send Correct Data to Correct Sheets
    By swordswinger710 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-04-2012, 03:53 PM
  5. [SOLVED] What's the correct format to check the name of a sheet?
    By Mikke in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-18-2006, 04:25 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