
Option Explicit
Sub scomponi()
Dim i As Integer, r As Range
Set r = Selection
For i = 1 To Len(r)
r.Offset(, i) = Mid(r, i, 1)
Next
End Sub
|
Option Explicit
Sub scomponi_2()
Dim v() As Variant, i As Integer
ReDim v(Len([a1]) - 1)
For i = 0 To Len([a1]) - 1
v(i) = Array(i, 1)
Next
[a1].TextToColumns Destination:=[b1], DataType:=xlFixedWidth, FieldInfo:=v
End Sub |
Option Explicit
Sub scomponi()
Dim intero As Integer, r As Range, ' variabile per colonna steep to steep rng As Range
'Set rng = Sheets("Foglio1").Range("i3:B" & Range("i" & Rows.Count).End(xlUp).Row)
Set r = Selection
For intero = 1 To Len(r)
r.Offset(, intero) = Mid(r, intero, 1)
Next
Set r = Nothing
End Sub |
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer, r As Range, rng As Range
'scompone il valore inserito nella cella che si sta editando
'inserendo le diverse cifre che la copongono nelle colonne a destra
If Intersect(Target, [I:I]) Is Nothing Then Exit Sub
If Target.Row < 3 Then Exit Sub
If Target = "" Then Exit Sub
Application.EnableEvents = False
Set r = Target
For i = 1 To Len(r)
r.Offset(, 17 + i) = Mid(r, i, 1)
Next
Application.EnableEvents = True
End Sub
|
