how do i use format cells to alpha / numeric values

  • Thread starter Thread starter Samvid69
  • Start date Start date
S

Samvid69

HAVE A STRING OF DATA i WANT TO ENTER into a cell, but I also want to set
format to set the values. eg. if I put in asd123 I want it to appear as
ASD123 but there are also occasions when I will put in a different mix of
letters/numbers a12s3d, which I also want to come out as A12S3D. I can do
this in Access but cant seem to crack the code in excel.

Please help.
 
Right on the sheet name tab and choice View Code and paste in the code below
after modifying the range to suit.


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub

On Error Resume Next
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
On Error GoTo 0

End Sub
 
Back
Top