I have a function that adds validation to a cell when a value is selected from a listbox in another cell.
This works fine when the sheet is unprotected but for some reason it will not work when it is protected.
I have added the unprotect sheet command to the code but it still wont work. When i do this in a Sub it works fine but doesnt work in a function.
Function tester(range1, range2, range3)
activesheet.unprotect
If range1 = "2" Then
range2.Validation.Delete
range2.Validation.Add Type:=xlValidateList, _ Formula1:="=INDIRECT(""F1:F3"")"
End If
End Function
Can someone help me out please?
Thanks
Welocme to the forum, Typicalalex1.
Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.
Thanks.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Cross posted.
http://www.mrexcel.com/forum/showthread.php?t=468547
Thread locked.
DominicB
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks