+ Reply to Thread
Results 1 to 5 of 5

VBA to Change Cell Value to Upper Case

  1. #1
    Forum Contributor
    Join Date
    02-23-2014
    Location
    Melbourne
    MS-Off Ver
    Microsoft 365
    Posts
    174

    VBA to Change Cell Value to Upper Case

    Hello Experts
    I have found a VBA that changes the value of cells in a column to uppercase, but the problem is i am getting a Run-time error '13' Type mismatch

    I think the reason is because the cell contains both alphabets and numbers

    What do I need to change in the VBA that it would accept alphanumeric data and only change the alphabets to uppercase?

    What I am entering into the cell is in this format aa-c8292 and want the VBA to change it to AA-C8292

    The VBA i am using is below, any help would be greatly appreciated

    Please Login or Register  to view this content.

    Regards
    Rahul
    Last edited by rahul_ferns76; 05-30-2022 at 10:02 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,918

    Re: VBA to Change Cell Value to Upper Case

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    02-23-2014
    Location
    Melbourne
    MS-Off Ver
    Microsoft 365
    Posts
    174

    Re: VBA to Change Cell Value to Upper Case

    Hi Alan
    Apologies for that

    I have updated the post to include a CODE wrap around the VBA code I posted
    Regards
    Rahul

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

    Re: VBA to Change Cell Value to Upper Case

    It should work only when the changing cell is one or not error value.

    If you need to change multiple cells then try.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-23-2014
    Location
    Melbourne
    MS-Off Ver
    Microsoft 365
    Posts
    174

    Re: VBA to Change Cell Value to Upper Case

    Thanks, Jindon
    It works

    Much appreciated

+ 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. [SOLVED] Change name format including adjusting upper case to lower case
    By johnmitch38 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-26-2019, 07:53 AM
  2. [SOLVED] Change Contents of Active Cell to Upper Case
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-13-2019, 11:52 AM
  3. Replies: 7
    Last Post: 10-13-2014, 12:23 PM
  4. Write a subroutine in a module to change case upon exit of a cell to upper case
    By Stephd22 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-15-2013, 06:39 PM
  5. Replies: 2
    Last Post: 12-09-2005, 05:15 AM
  6. How do I change a column in Excel from upper case to lower case?
    By Debbie Kennedy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-02-2005, 02:06 PM
  7. Replies: 3
    Last Post: 01-06-2005, 03:06 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