Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
Kitana pe Simpatie.ro
Femeie
25 ani
Bucuresti
cauta Barbat
25 - 48 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [EXCEL] VBA To Change Text Case in Selected Cells Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
Mrrrr
AdMiN

Inregistrat: acum 17 ani
Postari: 2228
I updated the code from source to act as a toggle, meaning that if you select a cell containing lowercase text, and click the button to the macro below created in your QAT for example, it will turn case to UPPERCASE. If then you click it again it will turn text to lowercase.

If text is mixed, both lower and upper, it will first turn the text into the case opposing the first letters, then if you click it again it will change to the opposite case, eg. if text is wd20EZBX it will first turn all letters to lowercase, then when you click the button again it will turn all letters to uppercase.

Cell selections don't need to be contiguous. You can use the CTRL key on your keyboard to select various cells all around.


Sub Upper_Lower_Toggle()
    For Each x In Selection
        If x.Value Like LCase(x.Value) Then
            x.Value = UCase(x.Value)
        Else
            x.Value = LCase(x.Value)
        End If
    Next
End Sub


Source of original code:


_______________________________________


pus acum 3 luni
   
Pagini: 1  

Mergi la