+ Reply to Thread
Results 1 to 7 of 7

Select case using a range

  1. #1
    Registered User
    Join Date
    04-19-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    50

    Select case using a range

    Hi,

    I'm creating a small spreadsheet for client data in Excel and I want it formatted a certain way, I did consider data validation but it proved to just be annoying.

    I've been working on some VBA code to automatically change whatever text is typed into a cell to the correct case (ucase, lcase or proper) and while I can get it working for a single range of cells getting it to work for more is proving difficult.

    This is what I have so far;
    Please Login or Register  to view this content.
    Last edited by royUK; 07-31-2009 at 06:13 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Select case using a range

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    I have added them this time
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    04-19-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Select case using a range

    I think I've fixed it

    Please Login or Register  to view this content.
    Appears to work, could probably do with bit of tidying up tho. I wonder is it possible to combine all the ranges that I want in upper case into a single case and then all the ranges I want in proper case into a single one etc? One case for each range will look pretty awful.

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Select case using a range

    Why not like this?
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-19-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Select case using a range

    Quote Originally Posted by StephenR View Post
    Why not like this?
    Well primarily becuase column B is to be in Proper Case and C an D are in Upper Case, but also because I don't want it to affect the column titles.

    I did try

    Please Login or Register  to view this content.
    But it wouldn't work, hence the cases. I'm Currently trying to tidy up the code a bit for instance, where I need C2:C65535 , D2:D65535 and say G2:G65535 in upper case is it possible to have all 3 ranges in the same case?

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Select case using a range

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-19-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Select case using a range

    Cheers, that didn't quite do it, but got me pretty close and I've figured it out now.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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