Hello,
I have the following VBA code in an excel worksheet. It worked fine until recently then it started throwing a run-time error. If I comment out the 4th line of code it doesn't error out but of course it also doesn't work.
The error it throws is:
Microsoft Visual Basic
Run-time error ‘2147417846 (80010108)’:
Method ‘Value2’ of object ‘Range’ Failed
Any idea how to make it work and why it stopped working? I'm using Office 2010. Thanks in advance, John
Private Sub Worksheet_Change(ByVal Target As Range) ' Proper Case column B & D
If Target.Column = 2 Or Target.Column = 4 Then 'Column A=1,B=2....)
If Target.Value = "" Then Exit Sub ' exit if cell is empty
Target.Value = Application.WorksheetFunction.Proper(Target.Value) 'proper case for cell
End If
End Sub
Bookmarks