Nombre con mayusculas

30/05/2005 - 19:26 por Fabian | Informe spam
Alguien me podria pasar un codigo para convertir un nombre con sus iniciales
en mayusculas

juan jose perez
Juan Jose Perez
Busque en Google, encontre esto:
Dim x As Range
For Each x In Selection
If VarType(x.Value) = vbString Then
x.Value = UCase(Left(x.Value, 1)) & LCase(Mid(x.Value, 2))
End If
Next

Lo uso asi: ActiveCell = UCase(Left(ActiveCell, 1)) & LCase(Mid(ActiveCell,
2))
pero no hace lo que necesito.
Gracias.
 

Leer las respuestas

#1 KL
30/05/2005 - 19:40 | Informe spam
Hola Fabian,

?Que tal esto?

Sub test()
With Range("A1")
.Value = WorksheetFunction.Proper(.Value)
End With
End Sub

Saludos,
KL


"Fabian" wrote in message
news:
Alguien me podria pasar un codigo para convertir un nombre con sus
iniciales
en mayusculas

juan jose perez
Juan Jose Perez
Busque en Google, encontre esto:
Dim x As Range
For Each x In Selection
If VarType(x.Value) = vbString Then
x.Value = UCase(Left(x.Value, 1)) & LCase(Mid(x.Value, 2))
End If
Next

Lo uso asi: ActiveCell = UCase(Left(ActiveCell, 1)) &
LCase(Mid(ActiveCell,
2))
pero no hace lo que necesito.
Gracias.


Preguntas similares