Report

Error in VBA [Solved]

Ask a question Newmie2013 10Posts Monday March 21, 2016Registration date May 11, 2016 Last seen - Latest answer on May 11, 2016 08:03AM
Hey,
So I Have the following code:
Sub GesamtlisteAenderung(ByVal Target As Range)
Dim x As Integer
If Intersect(Target, Columns("B:B")) Is Nothing Then Exit Sub
x = Target.Offset(0, -1).Value
ActiveSheet.Unprotect Password:="AufkeinenFallloeschen!"
Target.Offset(0, -1) = x
ActiveSheet.Protect Password:="AufkeinenFallloeschen!"
End Sub
and it works brilliantly! Buuuutttt.... Every Company has those that just can't handle Excel, no matter how simple we make it.
Problem is this: In Column B, there is a Dropdown Box with three Options: Mr., Ms., and Unknown.
Useres Need to pick on of the Options, and the code above kicks into gear in Column A.
But Some People inevitably try to enter words other than allowed. This creates an Error in VBA which calls for a Debugging. I Need to make that stop.
I Need this Workbook done ASAP, any Ideas or suggestions?
Thanks!
Newmie
See more 
Helpful
+0
moins plus
Sub GesamtlisteAenderung(ByVal Target As Range)
On Error GoTo Abbrechen
Dim x As Integer
If Intersect(Target, Columns("B:B")) Is Nothing Then Exit Sub
x = Target.Offset(0, -1).Value
ActiveSheet.Unprotect Password:="AufkeinenFallloeschen!"
Target.Offset(0, -1) = x
ActiveSheet.Protect Password:="AufkeinenFallloeschen!"

Abbrechen:
Exit Sub


End Sub
Add comment

Members get more answers than anonymous users.

Being a member gives you detailed monitoring of your requests.

Being a member gives you additional options.

Not a member yet?

sign-up, it takes less than a minute and it's free!