Solved

Text convert in excel

Posted on 2011-03-13
2
219 Views
Last Modified: 2012-08-13
Hello all

I need your help with a macro

I have text in column A.

I need to be able to take all text in column a and convert it like this in cell B1:

Ex:

ColumnA

Jean
Carl
Paul
Steve


B1 would be: "Jean", "Carl", "Paul", "Steve",


How can i do this please?

Thanks again

0
Comment
Question by:Wilder1626
2 Comments
 
LVL 24

Accepted Solution

by:
StephenJR earned 500 total points
Comment Utility
You could do it like this:
Sub x()

Dim r As Range, s As String

For Each r In Range("A1", Range("A1").End(xlDown))
    s = s & """" & r & """, "
Next r

Range("B1") = Mid(s, 1, Len(s) - 2)

End Sub

Open in new window

0
 
LVL 11

Author Closing Comment

by:Wilder1626
Comment Utility
Perfect

Thanks for your help
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now