Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrap cell contents in quotes 1

Status
Not open for further replies.

mstelmac

Technical User
Oct 22, 2003
53
0
0
US
Hello everyone. I hope everyone is enjoying the holiday season and not stuck in work like myself. I have an excel sheet in which I want to wrap the contents of every cell in quotes.

Example:
12345 Defect Severe Matt Johnson

Would look like this:
"12345" "Defect" "Severe" "Matt Johnson"


Can anyone help? I would really appreciate any suggestions. I thought that a macro would be nice so I could re-use it. I was messing with the concatenate function.

thanks,
Matt
 
Something like this ?
Sub addQuotes()
Dim c As Range
For Each c In ActiveSheet.UsedRange
If Left(c, 1) <> Chr(34) Then c = Chr(34) & Trim(c) & Chr(34)
Next
End Sub

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank you very much, that works great!
-Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top