+ Reply to Thread
Results 1 to 6 of 6

VBA Proper error 13

  1. #1
    Registered User
    Join Date
    03-31-2015
    Location
    england
    MS-Off Ver
    2010
    Posts
    3

    VBA Proper error 13

    I have created a code to auto capitalise a column and auto proper another column.
    The code works until I try to delete data from the proper column and I then get an error code which I cannot figure out how to correct.
    Any help would be much appreciated.

    Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
    If Not Intersect(Target, Range("I:I")) Is Nothing Then
    Target.Value = UCase(Application.Substitute(Target.Value, " ", ""))
    End If
    Application.EnableEvents = True
    Application.EnableEvents = False
    If Not Intersect(Target, Range("D:D")) Is Nothing Then
    Target.Value = StrConv(Target.Value, vbProperCase)
    End If
    Application.EnableEvents = True
    End Sub

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: VBA Proper error 13

    I copied your code into a blank excel spreadsheet, and did not have the problem at all
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    03-31-2015
    Location
    england
    MS-Off Ver
    2010
    Posts
    3

    Re: VBA Proper error 13

    Thank you for your reply Tom.
    It only seems to happen if I select multiple cells and press delete.

  4. #4
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: VBA Proper error 13

    You could also use On Error Resume Next

    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: VBA Proper error 13

    It is always better to write a code to handle multiple cells change and use of vba native function...
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-31-2015
    Location
    england
    MS-Off Ver
    2010
    Posts
    3

    Re: VBA Proper error 13

    Thanks to you both, working fine now.
    Have add rep both.
    Cheers.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 22
    Last Post: 05-14-2014, 07:27 AM
  2. Error? VLOOKUP returns 0 instead of proper value.
    By Hatchiman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-18-2010, 02:42 AM
  3. Basic Variable Error with Proper
    By flebber in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-29-2010, 04:20 AM
  4. Proper error catching runtime error 1004
    By randell.graybill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-14-2010, 01:07 AM
  5. [SOLVED] Trying to set up PROPER fx
    By Cherith Cutestory in forum Excel General
    Replies: 3
    Last Post: 04-19-2006, 11:55 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1