Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? | Excel Discussion (Misc queries) | |||
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER | New Users to Excel | |||
CSV file containing german characters imported into Excel | Excel Discussion (Misc queries) | |||
excel data label format special number characters (part 2) | Excel Discussion (Misc queries) | |||
Access -> Excel: How to export fields > 255 characters | Excel Discussion (Misc queries) |