
B1=RIPETI("0";MAX(LUNGHEZZA(TESTO($A$1:$A$10;"#,00")))-LUNGHEZZA(TESTO(A1;"#,00")))&TESTO(A1;"#,00")
100,00 00100,00
10,00 00010,00
1,00 00001,00
1000,00 01000,00
10000,00 10000,00
0,10 00000,10
11,00 00011,00
0,02 00000,02
150,00 00150,00
151,21 00151,21
|
=SE(O(A1="";VAL.TESTO(A1));"";RIPETI("0";MAX(LUNGHEZZA(TESTO($A$1:$A$10;"#,00")))-LUNGHEZZA(TESTO(A1;"#,00")))&TESTO(A1;"#,00"))
risultato
100 00100,00
Pippo
1 00001,00
1000 01000,00
10000 10000,00
0,1 00000,10
Pluto
0,02 00000,02
151,21 00151,21
|
Private Sub Label21_Click() Dim CL As Object cont = 0 Set X = Range(Cells(2, 8), Cells(2, 8).End(xlDown)) For Each CL In X If CL <> "" Then valore = Len(CL) If valore > cont Then cont = valore riga = CL.Row End If End If Next End Sub |
Set X = Range(Cells(2, 8), Cells(Rows.Count, 8).End(xlUp)) |
Sub Len__cella()
Dim Len_cella As Long
Dim Val_cella As Variant
Dim U_riga As Long
U_riga = Cells(Rows.Count, 8).End(xlUp).Row
Set MioRange = Range("H2:H" & U_riga)
Val_cella = Application.Max(MioRange)
Len_cella = Len(Format(Val_cella, "#.00"))
For Each cella In MioRange
If cella = "" Or Application.IsText(cella) Then
Cells(cella.Row, 10) = "" ''cella ''se bisogna lasciare invariata la cella
Else
Cells(cella.Row, 10) = Application.Rept("0", Len_cella - Len(Format(cella, "#.00"))) & Format(cella, "#.00")
End If
Next
Set MioRange = Nothing
End Sub
Risultato
0,02 00000,02
1 00001,00
250,21 00250,21
ciao
10000 10000,00
0,12 00000,12
50,15 00050,15
5,15 00005,15
|
