Question Locked

Excel ~ Special Cell Formatting

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Does anyone know how to format (maybe even build a specialized format) to apply to a specific Cell. For instance, I want a specific cell (A1) to capitalize anything that is entered into it (cell A1). (I don't want one cell to show the contents of another cell.) I need it all to be in one cell. Thank you.

3 replies

by bizzo

Need a macro to do this if you want it all in a single cell. Select the code page for the worksheet, select the dropdown at the top left (which should say '(general)'), pick 'Worksheet' then select the 'Change' member of the dropdown on the right.

Change this function to:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1:A1")) Is Nothing Then
Exit Sub
Else
For Each x In Range("A1:A1")
x.Value = UCase(x.Value)
Next
End If
End Sub

This means that whenever the contents of cell A1 (or whatever you set the range to) changes, it will change the contents to upper case.

by patricia.lynn

Thank you for this code. I don't think I'm doing it right, though, because when I enter something into the cell, really fast--it shows the contents turning to capital letters, and then closes the file. Can you tell me what I'm doing wrong?

This discussion is closed to new replies.