Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 27th, 2012, 10:00 AM
Authorized User
 
Join Date: Aug 2011
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Separation based on semi-colon

Hi,

I need a code that separates a string based on the semi-colon.

Eg: John;James;Sam;Tyler;Warden - (in a single cell)

O/P : John
James
Sam
Tyler
Warden

The O/p should be in different cells one below the other.

can anyone help me on this?

Thanks
 
Old February 27th, 2012, 01:44 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Here is a hint

Code:
Sub ConvertText2Range()
Dim sText As String, arText
sText = Range("c16").Value
arText = Split(sText, ";")
Range("D16:D" & CStr(16 + UBound(arText))).Value = WorksheetFunction.Transpose(arText)
End Sub
Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Separation between ui and bll flowjob BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 July 11th, 2007 08:55 AM
Looking for a good example of a Semi-Bound Form howardb1 Access VBA 0 April 24th, 2006 04:27 PM
Tier separation djm2cmu BOOK: ASP.NET Website Programming Problem-Design-Solution 2 February 29th, 2004 10:53 AM
Create a semi-colon delimited value rshano XSLT 1 January 14th, 2004 05:36 AM
(Semi) Automating Mail merge to Word Cryolith Access VBA 0 July 6th, 2003 10:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.