Solved

Text convert in excel

Posted on 2011-03-13
2
223 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
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

713 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