Monday, September 26, 2016

How to Resolve - Detailed question about combining a column of names into one cell?

Detailed question about combining a column of names into one cell

I have a column of names.  Each cell is formatted like this:
Last Name, First Name (for example: Smith, John)
I need to combined all of the names into one cell, but I need single quotes around each name and a comma in between each cell.  So the end result would look something like this:
'Smith, John','Gates, Bill','Jobs, Steve'
Is there any quick way of doing this?

Keys to the Problem Detailed question about combining a column of names into one cell

Download Error Fixer for Free Now

Create a short User Defined Function or UDF that will loop through the values in a supplied range and concatenate them according to your desired format.
Right click the worksheet's tab and select View Code.
This will send you to the Visual Basic Editor or VBE.
Immediately use the pull down menus to Insert, Module.
Paste the following code into the new window pane,
Public Function fcnGatherNames(target As Range) As String
    Dim sNames As String
    sNames = ""
    For Each c In target.Cells
        sNames = sNames & Chr(39) & c.Value & Chr(39) & Chr(44)
    Next
    fcnGatherNames = Left(sNames, Len(sNames) - 1)
End Function
...
and press ALT+Q to return to the worksheet.
Use it like this,
=fcnGatherNames(A1:A99)
...
where A1:A99 is the range of names.
BTW, Chr(39) is a single quote and Chr(44) is a comma.

"Have you tried turning it off and then on again?" - Roy from 'The IT Crowd' (Emmy award-winning British comedy)

Cleaning your computer, components, and peripherals help keep everything in good working condition and helps prevent germs from spreading. You can't image how dirty the inside of your computer case can get. All the dust and dirt is going to prevent proper air flow and may even prevent the fan from working.

Another Safe way to Repair the Problem: Detailed question about combining a column of names into one cell:

How to Fix Detailed question about combining a column of names into one cell with SmartPCFixer?

1. Download Error Fixer. Install it on your computer.

2. After the scan is done, you can see the errors and problems need to be fixed. Click Fix All.

3. When the Fixing part is finished, your computer has been speeded up and the errors have been removed


Related: How to Update & Download NVidia GeForce 6100/nForce 420 WHQL Certified driver v.178.13,How to Update & Download NVidia GeForce 7600 GS Video Driver v.295.75 Certified,How Can I Update & Download NVidia GeForce 820M Driver v.344.48 WHQL,[Solved] Download NVidia GeForce GTX 560M VGA Driver v.296.17 Certified,Way to Update & Herunterladen NVidia GeForce GT 130M Video Treiber v.295.75 Certified,How to Update & Download SONY SVE14A1X1RH Realtek Ethernet Driver,Where to Download SONY SVS13A2W9ES Bluetooth Driver (Intel) v.2.6 - 2.6.23.40059,Best Way to Update & Download SONY VGN-CR203E Conexant HDAUDIO SoftV92 Data Fax Modem with SmartCP Setup Program v.7.62.0.50 driver,Best Way to Download SONY VGN-FE790G/N Wireless LAN Driver v.10.6.0.29,Method to Update & Download SONY VGN-NR31Z/S Firmware Extension Parser Device v.8.0.2.3,How to Fix Error 0x0000c1f5 Solución?,Error 0x80071a91 Win7 Fix Patch,Error 0x800ccc60 Windows Live Mail [Solved],Error Message 0x800ccc79 Outlook 2000 Fix,What is Error 0xc1ab0001?,[Answered] x64 saplugin dll,How to Fix Problem - Kb943729 Download?,Troubleshooting: Bccode D1 Error,Java Runtime Tech Support,Troubleshooting: ERROR NO SUCH GROUP Error
Read More: Troubleshoot:Dell Data Safe Local Back up problem Error,Default Gateway will not save on any network adapter,How to Fix - Desktop gadgets appear blank.?,Troubleshooter of Error: Dell keyboard problem,Troubleshoot:Default Mail Client Is Not Properly Installed. How Do I Fix This ? Error

No comments:

Post a Comment