ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   allcaps option in excel like word (https://www.excelbanter.com/excel-programming/397474-allcaps-option-excel-like-word.html)

capital letter[_2_]

allcaps option in excel like word
 
If I write any text in a cell of ms excel that should be automatically upper
case like ms word. So how can i do ? suggest me.

Mike H

allcaps option in excel like word
 
Hi,

Press the capslock key?

Mike

"capital letter" wrote:

If I write any text in a cell of ms excel that should be automatically upper
case like ms word. So how can i do ? suggest me.


Bill Renaud

allcaps option in excel like word
 
Mike's suggestion is the simplest, but if you must insure that a user
enters all CAPS, even if the CAPS LOCK key if off, you might add an
event handler to the worksheet. The routine below checks to see that the
data entered is actually text. It also turns off other events, so that a
formula can be entered. Events are turned on again, even if an error
occurs. Right click on the worksheet tab, then choose "View Code" at the
bottom of the menu. Paste the following code into the editor window:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngCell As Range

On Error GoTo ErrExit

Application.EnableEvents = False

For Each rngCell In Target
With rngCell
If WorksheetFunction.IsText(.Value) _
Then
.Value = UCase(.Value)
End If
End With
Next rngCell

ErrExit:
Application.EnableEvents = True
End Sub
--
Regards,
Bill Renaud




All times are GMT +1. The time now is 05:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com