Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
gwc gwc is offline
external usenet poster
 
Posts: 62
Default Alt+Enter character

A cell contains:

PROD.FTPLIB(CRTUPL01)PROD.FTPLIB(CRTUPL02)PROD.FTP LIB(CRTUPL03)


What do I type in the REPLACE WITH: box so each right parenthesis is replaced with a right parenthesis followed by a carriage-return character so the result is:

PROD.FTPLIB(CRTUPL01)
PROD.FTPLIB(CRTUPL02)
PROD.FTPLIB(CRTUPL03)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Alt+Enter character

Hi,

Am Mon, 8 Dec 2014 10:38:06 -0800 (PST) schrieb GWC:

What do I type in the REPLACE WITH: box so each right parenthesis is replaced with a right parenthesis followed by a carriage-return character so the result is:

PROD.FTPLIB(CRTUPL01)
PROD.FTPLIB(CRTUPL02)
PROD.FTPLIB(CRTUPL03)


if you replace ")" with ")" Alt0010 you have a new line behind the
string.
Try it with a macro:

Sub Test()
Dim len1 As Long, len2 As Long
With Range("A1")
len1 = InStr(.Value, ")")
len2 = InStr(len1 + 1, .Value, ")")
.Value = Left(.Value, len1) & Chr(10) & _
Mid(.Value, len1 + 1, len2 - len1) & Chr(10) & _
Mid(.Value, len2 + 1)
.WrapText = True
.EntireRow.AutoFit
.EntireColumn.AutoFit
End With
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #3   Report Post  
Posted to microsoft.public.excel.programming
gwc gwc is offline
external usenet poster
 
Posts: 62
Default Alt+Enter character

Hi Claus B.,

Replace ")" with ")" Alt0010 worked great but now:

How can I retain the carriage-returns if I type =LEFTA(A1,60) in column B1 and =mid(a1,61,100) in column C1?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Alt+Enter character

Hi,

Am Mon, 8 Dec 2014 16:48:08 -0800 (PST) schrieb GWC:

How can I retain the carriage-returns if I type =LEFTA(A1,60) in column B1 and =mid(a1,61,100) in column C1?


replace ")" with ")"Alt0010 and write in B1:
=LEFT(A1,LEN(A1)-1)
to delete the last new line


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Alt+Enter character

Hi again,

Am Mon, 8 Dec 2014 16:48:08 -0800 (PST) schrieb GWC:

How can I retain the carriage-returns if I type =LEFTA(A1,60) in column B1 and =mid(a1,61,100) in column C1?


you can also work with TextToColumns. Set ")" as separator and choose in
step 3 B1 as target cell. Now you have your substrings in B1:D1. Then
write in A1:
=B1&CHAR(10)&C1&CHAR(10)&D1
Copy A1 and paste special as values that you can delete B1:D1


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
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
Alt Enter Creates Tab Character W Excel Discussion (Misc queries) 2 April 5th 12 12:47 AM
How to remove Alt+Enter character in a worksheet? Lang Du Excel Discussion (Misc queries) 9 February 5th 07 08:26 PM
How do I enter a slash character in excel? michaelgreen Excel Discussion (Misc queries) 1 June 14th 05 02:22 AM
Alt + Enter Character Number Frank Kabel Excel Programming 0 August 11th 04 07:34 PM
DDE an Alt-Enter (Newline) character Ross Field Excel Programming 2 May 13th 04 04:12 PM


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

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

About Us

"It's about Microsoft Excel"