+ Reply to Thread
Results 1 to 6 of 6

VB script not working

  1. #1
    Registered User
    Join Date
    03-26-2013
    Location
    Wichita, Kansas
    MS-Off Ver
    Excel 2010
    Posts
    7

    VB script not working

    I have used the script below in other spreadsheets to convert text to all caps as the user inputs data but, for some reason, it's not working. Am I doing something wrong? I got this script off the internet and it has worked for me for a year. I am not educated in VB so please dumb down the responses for me, please! thanks!

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim actionRange As Range
    Dim oneCell As Range

    Set actionRange = Range("b3:ABC5000"): Rem adjust

    Set actionRange = Application.Intersect(Target, actionRange)
    If Not actionRange Is Nothing Then
    On Error GoTo ErrorHalt
    Application.EnableEvents = False

    For Each oneCell In actionRange
    oneCell.Value = UCase(oneCell.Value)
    Next oneCell

    End If
    ErrorHalt:
    Err.Clear
    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: VB script not working

    I tested it in a blank spreadsheet and it worked fine. Your range is set to B:3, so anything before cell B:3 wont be converted to all caps, everything after will. Where did you paste the code? I pasted it into Sheet1.

  3. #3
    Registered User
    Join Date
    03-26-2013
    Location
    Wichita, Kansas
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: VB script not working

    Yes, it is in Sheet 1. I don't need anyting in rows 1 or 2 or in column A converted as I have those cells locked and I have the sheet protected. Could that be the reason why it's not working?

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

    Re: VB script not working

    It could be that the sheet is protected. If I protect my sheet, it wont work at all, in fact I get a message saying I need to unprotect sheet before I can make changes.

  5. #5
    Registered User
    Join Date
    03-26-2013
    Location
    Wichita, Kansas
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: VB script not working

    Well, I must have really hosed something up. It won't work if I unprotect it either. And I tried in a blank spreadsheet like you did and couldn't get it to work there, either. Ugh. Thanks for your help though!

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

    Re: VB script not working

    You're welcome. If you decide you need more help with this, let me know. Sorry we didn't get it figured out.
    Last edited by gmr4evr1; 12-04-2014 at 04:57 PM.

+ 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. Script not working Error13 Please help
    By archangel9999 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-11-2014, 10:55 AM
  2. This script isn't working, why not?
    By ledworld in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2013, 06:04 PM
  3. [SOLVED] VBA Script has stopped working
    By Philfy in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-10-2013, 11:24 AM
  4. [SOLVED] my if-then-else script is not working
    By dschmitt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-01-2013, 02:24 AM
  5. VBA Script to open table in DB not working
    By DC88310 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2011, 04:20 PM

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