Limiting the SPLIT function...

Aitch

Board Regular
Joined
Jan 27, 2019
Messages
61
ABC - DEF - GHI - JKL - MNOABCDEFGHIJKLMNO
ABC - DEF - GHI - JKL - MNOABCDEF

<tbody>
</tbody>

Using SPLIT with a "-" delimiter gives the first output above - is there a way to limit the command so it splits ONLY the first two parts?

Thanks for your help!
 

veyselemre

Board Regular
Joined
Mar 16, 2006
Messages
55
Code:
Sub test()
    Range("B1").Resize(, 2).Value = Split(Range("A1").Value, "-", 3)
End Sub
 

Forum statistics

Threads
1,085,099
Messages
5,381,709
Members
401,751
Latest member
bschiebe

Some videos you may like

This Week's Hot Topics

Top