excel - Data validity checks -
i have document want check number of columns see if formatted correctly. values incorrect want have msgbox displays values , locations (each on separate line) of each instance.
just in case there large number of mistakes desire messagebox each column. below have partial code cl.address2 / value2 need change , possibly vbanextline that's it. thank you!
sub datachecks dim cl range each cl in range("a:a") if cl.format = "dd/mm/yyyy" msgbox(cl.address & cl.value & vbanextline & cl.address2 & cl.value)
i make each explicitly referring cells. keep track of cells found use local string variable, add lines found , carriage return or line feed (= chr(13)). made small corrections here , there well, should it:
sub datachecks() dim cl range dim foundcells string each cl in range("a:a").cells if cl.numberformat = "dd/mm/yyyy" foundcells = foundcells & cl.address & " " & cl.value & chr(13) end if next cl msgbox (foundcells) end sub
Comments
Post a Comment