+ Reply to Thread
Results 1 to 10 of 10

single quote/CID/single quote/comma

Hybrid View

  1. #1
    Registered User
    Join Date
    02-06-2014
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    single quote/CID/single quote/comma

    I have a worksheet which includes a column that has anywhere from 6-14 digits. After data is entered for this project I need to copy the digits from excel to a notepad. Please see how the format should read in notepad below.

    I found a way to format adding the single quote and comma but not the carriage return. Is there a simple formula for this?

    EXCEL

    728474
    1002208755
    1001873448
    783715
    791490


    Notepad

    ('728474','1002208755','2018551436','1001873448','783715','791490')

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: single quote/CID/single quote/comma

    Are you OK with using a VBA function to do this?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: single quote/CID/single quote/comma

    If so, copy the code at this link:

    http://www.excelforum.com/showthread...=1#post3096647

    Paste it into a general module.

    Then, use it on the worksheet like this:

    Data Range
    A
    B
    1
    2
    728474
    ('728474','1002208755','1001873448','783715','791490')
    3
    1002208755
    4
    1001873448
    5
    783715
    6
    791490


    This array formula** entered in B2:

    ="("&concatall("'"&A2:A6&"'",",")&")"

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

  4. #4
    Registered User
    Join Date
    02-06-2014
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: single quote/CID/single quote/comma

    Thanks Tony....however now I'm getting the following error:

    728474 #NAME?
    1002208755
    1001873448
    783715


    791490

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: single quote/CID/single quote/comma

    Did you put the VBA code in the right place?

  6. #6
    Registered User
    Join Date
    02-06-2014
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: single quote/CID/single quote/comma

    I am new to this so please bare with me. I copied the code in VB via insert module, then place the VBA code in cell B2. Now I'm coming up with the following:

    ('728474','1002208755','1001873448','783715','791490','','',''

    How do you ignore the empty cells and add a parenthesis at the end?

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: single quote/CID/single quote/comma

    Try this
    =123456 & CHAR(10) & 235698 & CHAR(10) & 34567
    Format the cell to wrap text, right click the cell=>select format cells select the Alignment tab and check Wrap Text

  8. #8
    Registered User
    Join Date
    02-06-2014
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: single quote/CID/single quote/comma

    OMG, it worked. Thank you

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: single quote/CID/single quote/comma

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to find and replace hidden single quote ? (This sign is single quote: ')
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-19-2014, 03:48 PM
  2. Single Quote
    By Kinjalip in forum Excel General
    Replies: 4
    Last Post: 04-06-2006, 07:30 AM
  3. adding a single quote and comma to every cell in Excel
    By rodsheffield in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-04-2005, 04:05 PM
  4. Leading single quote
    By AA2e72E in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2005, 07:06 AM
  5. What does SINGLE QUOTE mean before value in a cell?
    By surotkin in forum Excel General
    Replies: 2
    Last Post: 04-13-2005, 08:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1