Sub FourColumns()
With Range("B2:B" & Range("A" & Rows.Count).End(xlUp).Row)
.Formula = "=IF(ISNUMBER(LEFT(A2,1)+0),"" "","""") & A2"
.Value = .Value
.TextToColumns DataType:=xlDelimited, Space:=True, Other:=False
End With
End Sub
Assuming the original strings are in column A staring at row 2, try this.
VBA Code:Sub FourColumns() With Range("B2:B" & Range("A" & Rows.Count).End(xlUp).Row) .Formula = "=IF(ISNUMBER(LEFT(A2,1)+0),"" "","""") & A2" .Value = .Value .TextToColumns DataType:=xlDelimited, Space:=True, Other:=False End With End Sub
You're welcome.Many tnks
Does this do what you want?...and with:
38 CROI-LOGIS
B/152 RIOV LOGI SRL
B/56 SCARRONI
IN 2 COLUMNS ?
Sub TwoColumns()
With Range("B2:B" & Range("A" & Rows.Count).End(xlUp).Row)
.Value = Evaluate("substitute(" & .Offset(, -1).Address & ","" "","";"",1)")
.TextToColumns DataType:=xlDelimited, Semicolon:=True, Space:=False, Other:=False
End With
End Sub
... sorry I get:Sub TwoColumns() With Range("B2:B" & Range("A" & Rows.Count).End(xlUp).Row) .Value = Evaluate("substitute(" & .Offset(, -1).Address & ","" "","";"",1)") .TextToColumns DataType:=xlDelimited, Semicolon:=True, Space:=False, Other:=False End With
38 | CROI-LOGIS |
38 | CROI-LOGIS |
38 | CROI-LOGIS |
38 | CROI-LOGIS |
B/152 | RIOV LOGI SRL |
B/56 | SCARRONI |
Probably related to your excel version which is why suggested ...... sorry I get:
... that you update your Account details to show us version information as it may affect the most appropriate suggestion.