here is a peculiar problem.
i am having a cell(text type) which is to be checked for length 20 chars.i am checking using a macro like
If (Target.Address = "$A$14") Then
If Len(Trim(CStr(.Cells(14, 3).Value))) > 10 Then
MsgBox " Error:Error: Length of comments field cannot have more than 10 characters.", vbDefaultButton1 +
vbExclamation, "TMS Error"
Application.EnableEvents = False
Application.EnableEvents = True
If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
i can do this without a macro i.e using data->validation->text length is less than 20 etc.. but what happens is when
the user copy some text(has more than 20 chars) from other text editor(like notepad) and copy into this cell, then it will
allow him.which is wrong. so i have to use a macro.
this cell has got some border too.
problem 1#) when i copy data from notepad to this cell this border is lost.
how can i prevent the border being lost.
problem 2#) when i paste data from notepad to this cell its type is changed to General(from text) and the cell is getting
locked(but my sheet is protected) . how can i avoid this?
thanks alot for ur patience