Hi guys.. I am new to excel macros.. hence 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”.
allowed conditions are listed below. If error conditions are raised show the Error message to the “Result” column line.
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#"
If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
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”