Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DannyDont
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DannyDont
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DannyDont
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David McRitchie
 
Posts: n/a
Default 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" wrote in message ...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER MEGTOM New Users to Excel 5 October 27th 05 03:06 AM
CSV file containing german characters imported into Excel Peter @ fjs Excel Discussion (Misc queries) 0 October 26th 05 05:32 PM
excel data label format special number characters (part 2) todd Excel Discussion (Misc queries) 1 May 4th 05 04:08 PM
Access -> Excel: How to export fields > 255 characters Gabriel Martin Excel Discussion (Misc queries) 1 March 9th 05 01:37 PM


All times are GMT +1. The time now is 07:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"