Results 1 to 2 of 2

Check the length and value of specific columns and comparion check between two sheets

Threaded View

sravanthi.boggaram Check the length and value of... 12-06-2011, 01:02 AM
Marcol Re: Check the length and... 12-06-2011, 06:51 AM
  1. #1
    Registered User
    Join Date
    11-07-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    16

    Check the length and value of specific columns and comparion check between two sheets

    Hi guys.. I require help in writing macros for the following checks.. I am also attaching the sample workbook below..


    1. Validation check_1: Check the length and value of “Customer#/ADU”.

    The allowed conditions are listed below. If error conditions are raised show the Error message to the “Result” column line.

    Column name Length Value Error Message
    Customer# 6byte “No check” ERROR:Invalid Customer#
    ADU 1byte 2/3/7 ERROR:Invalid ADU

    I have used this snippet but it doesn't seem to work..
    lastrow = Worksheets("Main data").Range("A" & Rows.Count).End(xlUp).Row 
    mx = 6 
    For i = 9 To lastrow 
        If Len("B" & i) < mx Then 
            Range("G" & i).Value = "ERROR:Invalid Customer#" 
            Enf If 
        Next i
    2. Validation Check_2: Check the “Data Value”
    Check the length of “Data Value” filed. Get the information of correct length of each value from “Length” field of “Table information”. “Blank” is also allowed for exceptionally condition..
    If error condition is raised, show the Error message” ERROR: Invalid Data value” to the “Result line” field on “Main data” sheet.


    Regards

    Sravanthi
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

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