+ Reply to Thread
Results 1 to 5 of 5

Excel 'Special' Characters in Expressions

  1. #1
    DannyDont
    Guest

    Excel 'Special' Characters in Expressions

    I have a need to be able to create a funtion/expression that can issue a
    'hard carriage return & line feed'. On the keyboard this would be 'Alt' +
    'Enter'. I want to take two (or more) cells and combine them into one cell
    with each value on it's own 'line' in the receiving cell.
    ============================
    Receiving Cell Cell 1 Cell 2
    Smith John Smith
    John
    ============================
    I am trying to create a Membership Directory for print and distribution. I
    do having it working by determining the length of the Sending Cell and then
    padding the end with 'n' spaces depending on the size of the Receiving Cell
    and the length of the Sending Cell. This works but is rather arbitrary
    unless using fixed fonts which is not reasonable.
    Could I capture this 'special' character by recording a macro (which I will
    try)? Or does someone know what this 'special' character might be?

    Thanks for any help you might provide,
    DannyDont

  2. #2
    Dave Peterson
    Guest

    Re: Excel 'Special' Characters in Expressions

    In excel:
    =a1&char(10)&b1

    in VBA:
    with activesheet
    .range("c1").value = .range("a1").value & vblf & .range("b1").value
    end with

    alt-enter = char(10) = vblf = chr(10)

    These are line feeds.

    Carriage returns are char(13), vbCR, or Chr(13). But don't use them in your
    cells. You want alt-enters.

    DannyDont wrote:
    >
    > I have a need to be able to create a funtion/expression that can issue a
    > 'hard carriage return & line feed'. On the keyboard this would be 'Alt' +
    > 'Enter'. I want to take two (or more) cells and combine them into one cell
    > with each value on it's own 'line' in the receiving cell.
    > ============================
    > Receiving Cell Cell 1 Cell 2
    > Smith John Smith
    > John
    > ============================
    > I am trying to create a Membership Directory for print and distribution. I
    > do having it working by determining the length of the Sending Cell and then
    > padding the end with 'n' spaces depending on the size of the Receiving Cell
    > and the length of the Sending Cell. This works but is rather arbitrary
    > unless using fixed fonts which is not reasonable.
    > Could I capture this 'special' character by recording a macro (which I will
    > try)? Or does someone know what this 'special' character might be?
    >
    > Thanks for any help you might provide,
    > DannyDont


    --

    Dave Peterson

  3. #3
    DannyDont
    Guest

    RE: Excel 'Special' Characters in Expressions

    Well, I answered my own question by recording a Macro. This macro replaced
    the 'Alt' + 'Enter' with a Chr(10). Of course this was VB for Excel and
    wouldn't you know that the command was different in an Excel Expression.
    But, it was an easy find to go from Chr(10) to CHAR(10). Thanks for all your
    help. Sometimes it just takes explaining something to others to turn the
    light on!!!!

    DannyDont


    "DannyDont" wrote:

    > I have a need to be able to create a funtion/expression that can issue a
    > 'hard carriage return & line feed'. On the keyboard this would be 'Alt' +
    > 'Enter'. I want to take two (or more) cells and combine them into one cell
    > with each value on it's own 'line' in the receiving cell.
    > ============================
    > Receiving Cell Cell 1 Cell 2
    > Smith John Smith
    > John
    > ============================
    > I am trying to create a Membership Directory for print and distribution. I
    > do having it working by determining the length of the Sending Cell and then
    > padding the end with 'n' spaces depending on the size of the Receiving Cell
    > and the length of the Sending Cell. This works but is rather arbitrary
    > unless using fixed fonts which is not reasonable.
    > Could I capture this 'special' character by recording a macro (which I will
    > try)? Or does someone know what this 'special' character might be?
    >
    > Thanks for any help you might provide,
    > DannyDont


  4. #4
    DannyDont
    Guest

    Re: Excel 'Special' Characters in Expressions

    Dave,

    Thank you very much. As you were providing the answer, I was recording a
    Macro and discovering the information that you provided. When using Help in
    Excel, I just didn't think about the CHAR worksheet function. Perhaps if I
    had asked a question rather than using the index it would have been easier.

    Thanks for your RAPID response.

    DannyDont
    -------------------------------------------------------------------


    "Dave Peterson" wrote:

    > In excel:
    > =a1&char(10)&b1
    >
    > in VBA:
    > with activesheet
    > .range("c1").value = .range("a1").value & vblf & .range("b1").value
    > end with
    >
    > alt-enter = char(10) = vblf = chr(10)
    >
    > These are line feeds.
    >
    > Carriage returns are char(13), vbCR, or Chr(13). But don't use them in your
    > cells. You want alt-enters.
    >
    > DannyDont wrote:
    > >
    > > I have a need to be able to create a funtion/expression that can issue a
    > > 'hard carriage return & line feed'. On the keyboard this would be 'Alt' +
    > > 'Enter'. I want to take two (or more) cells and combine them into one cell
    > > with each value on it's own 'line' in the receiving cell.
    > > ============================
    > > Receiving Cell Cell 1 Cell 2
    > > Smith John Smith
    > > John
    > > ============================
    > > I am trying to create a Membership Directory for print and distribution. I
    > > do having it working by determining the length of the Sending Cell and then
    > > padding the end with 'n' spaces depending on the size of the Receiving Cell
    > > and the length of the Sending Cell. This works but is rather arbitrary
    > > unless using fixed fonts which is not reasonable.
    > > Could I capture this 'special' character by recording a macro (which I will
    > > try)? Or does someone know what this 'special' character might be?
    > >
    > > Thanks for any help you might provide,
    > > DannyDont

    >
    > --
    >
    > Dave Peterson
    >


  5. #5
    David McRitchie
    Guest

    Re: Excel 'Special' Characters in Expressions

    What's wrong with just using the Excel worksheet for a directory listing.

    Sounds more like you are formatting for printing labels, in which case
    you would use Excel as the database and print with MS Word.
    http://www.mvps.org/dmcritchie/excel/mailmerg.htm
    ---
    HTH,
    David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
    My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
    Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

    "DannyDont" <[email protected]> wrote in message news:[email protected]...
    > Well, I answered my own question by recording a Macro. This macro replaced
    > the 'Alt' + 'Enter' with a Chr(10). Of course this was VB for Excel and
    > wouldn't you know that the command was different in an Excel Expression.
    > But, it was an easy find to go from Chr(10) to CHAR(10). Thanks for all your
    > help. Sometimes it just takes explaining something to others to turn the
    > light on!!!!
    >
    > DannyDont
    >
    >
    > "DannyDont" wrote:
    >
    > > I have a need to be able to create a funtion/expression that can issue a
    > > 'hard carriage return & line feed'. On the keyboard this would be 'Alt' +
    > > 'Enter'. I want to take two (or more) cells and combine them into one cell
    > > with each value on it's own 'line' in the receiving cell.
    > > ============================
    > > Receiving Cell Cell 1 Cell 2
    > > Smith John Smith
    > > John
    > > ============================
    > > I am trying to create a Membership Directory for print and distribution. I
    > > do having it working by determining the length of the Sending Cell and then
    > > padding the end with 'n' spaces depending on the size of the Receiving Cell
    > > and the length of the Sending Cell. This works but is rather arbitrary
    > > unless using fixed fonts which is not reasonable.
    > > Could I capture this 'special' character by recording a macro (which I will
    > > try)? Or does someone know what this 'special' character might be?
    > >
    > > Thanks for any help you might provide,
    > > DannyDont




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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