Puoi usare la funzione MAIUSC.INIZ()
Ciao
Barbara
.-----------------
> per la conversione uso la formaula testo "minuscolo" ma vorrei lasciare le
> iniziali (nome e cognome) in Maiuscolo.
> Come posso farlo in automatico visto ke sono 300 nomi e cognomi?
.-----------------
Prova:
'=============>>
Public Sub ChangeCase()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range
Dim PrimaCella As Range
Dim rCell As Range
Dim iLastRow As Long
Set WB = ThisWorkbook
Set SH = WB.Sheets("Foglio1") '<<=== da CAMBIARE
Set PrimaCella = Range("A1") '<<=== da CAMBIARE
Set Rng = PrimaCella.CurrentRegion.Columns(1).Resize(, 2)
On Error Resume Next
With Rng
Set Rng = Intersect(.Cells, _
.SpecialCells(xlCellTypeConstants, xlTextValues))
End With
On Error GoTo 0
If Not Rng Is Nothing Then
For Each rCell In Rng.Cells
With rCell
.Value = StrConv(.Value, vbLowerCase)
'OPPURE:
' .Value = StrConv(.Value, vbProperCase)
End With
Next rCell
End If
End Sub
'<<=============
Per utilizzare questa macro:
Alt-F11 per aprire l'Editor di VBA
Menu | Inserisci | Modulo
Incollarci il suddeto codice
Alt-F11 per tornare in Excel
Alt-F8
Seleziona "ChangeCase"
Esegui
---
Regards,
Norman
Sostituisci il codice suggerito con la seguente versione:
'=============>>
Public Sub ChangeCase()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range
Dim PrimaCella As Range
Dim rCell As Range
Dim iLastRow As Long
Set WB = ThisWorkbook
Set SH = WB.Sheets("Foglio1") '<<=== da CAMBIARE
Set PrimaCella = Range("A1") '<<=== da CAMBIARE
Set Rng = PrimaCella.CurrentRegion.Columns(1).Resize(, 2)
On Error Resume Next
With Rng
Set Rng = Intersect(.Cells, _
.SpecialCells(xlCellTypeConstants, xlTextValues))
End With
On Error GoTo 0
If Not Rng Is Nothing Then
For Each rCell In Rng.Cells
With rCell
.Value = StrConv(.Value, vbProperCase)
End With
Next rCell
End If
End Sub
'<<=============
---
Regards,
Norman
Scusa, vedendo la risposta di Norman, mi sono accorta di avere ignorato la
parola 'in automatico' presente nella tua richiesta.
Per usare la funzione che ti ho indicato, in ogni caso, ti basterebbe usare
una colonna di appoggio in cui inserisci la formula (ad esempio, se hai i
dati in A1:A300):
=MAIUSC.INIZ(A1)
e la trascini in basso
quindi selezioni questo intervallo > modifica > copia
Poi selezioni A1: modifica > incolla speciale > [x] valori
Non è proprio automatico, ma non è neanche improponibile!
Ciao
Barbara