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 June 13th, 2004, 08:23 AM
Registered User
 
Join Date: Jun 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default stripping string and placing into cells

hey all

is it possible to strip each item from the below string and then place each item into a separate cell?

ie. I have a cell content such as:

U 25 Stewart, Patrick, A 100.64 0.00 123.35 0.00 0.00 0.00 25000.00 3555.01- 290.33

and would like to place each item into ajoining cells in a row (the name can be taken as one long string)

thanks



 
Old June 13th, 2004, 09:22 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to acdsky
Default

Hi

You could use split to split your data up e.g
******
X = Split(URStringvar, " ")
myVar = X(0)
********
If you look at the obove piece..URStringvar is the variable containing your string. MyVar will be the value to insert in the cells where 0 would take the first part up to the space, if you change 0 to 1 it will take the second part after the space.

You will have to build some "counting logic" into your program to get "U 25 Stewart, Patric, A" into one cell. So maybe only get the data for 5 splits and contanate, insert, and then do the rest in a seperate cell.

Hope this helps, let me know if you need assitance with the logic to get the name in one cell.

Regards
Marnus





Similar Threads
Thread Thread Starter Forum Replies Last Post
Stripping Data from a Field jjc9809 Access VBA 1 July 12th, 2008 08:16 PM
Stripping CRLF?? crabjoe Classic ASP Basics 7 February 26th, 2008 05:58 PM
Stripping last X characters fixxer XSLT 2 September 21st, 2007 05:11 PM
Stripping hyphens arholly Access 2 January 4th, 2007 09:16 AM
Stripping down variable values mellan XSLT 1 September 19th, 2005 09:00 AM





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