Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Text convert in excel

Posted on 2011-03-13
2
Medium Priority
?
230 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 2000 total points
ID: 35122102
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
ID: 35122145
Perfect

Thanks for your help
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
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 the scrolling table in Microsoft Excel using the INDEX function.

972 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