Sub Macro1()
'
' Macro1 Macro
'
'
Selection.TextToColumns Destination:=Range("B2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:=";", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
End Sub
But i have Spaces in that data so i want to remove all those then that email ID send the email can u please help me to do all in VBA
When data are well organized and with a purpose to separate data
to columns, TextToColumns method is the fastest !
Luke M but what i tried is this correct please tell meTextToColumns is meant to split text over a range of cells.
Split is meant to split text into multiple strings within VB.
If you wanted to learn about Split, state that in your OP. Don't say you want to split cells into range and then refuse to accept the best answer. You're trying to do the equivalent of making 3 left turns instead of 1 right turn. Or a better metaphor would be if you asked "How do I turn on a car?" and we gave the answer "Turn the key", and you then said "Well I want to use a piece of wire". You might get the same result eventually, but you made it 100x more complicated.
As Marc said, you aren't new to VB. We've been helping you in this forum for quite some time. Take some time to read through some of the previously posted code (in your own threads and in others), learn how it works, and read the VB help.
Sub test()
Dim Rng As Range, arr As Variant
For Each Rng In ActiveSheet.Range("a1:A" & Cells(Rows.Count, 1).End(xlUp).Row)
arr = Split(Rng, ";")
Rng.Offset(0, 1).Resize(, UBound(arr) + 1).Value = arr
Next
End Sub