LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Auto-Insert Line Break (Alt+Enter)?

Jim,

Thanks for the help. Just two quick questions. (A) Where do I put in that
script to tell it which column to search? (B) I'm not the greatest at VBA
and played with it a few years ago. Can I just create a blank macro with the
recorder and then just dump that script into it?

Thanks.

Doug

"Jim Rech" wrote:

I don't think you can search for the end of a line of text. I think I'd do
it this way:

Sub a()
Dim Cell As Range
Dim CellVal As String
For Each Cell In Selection
CellVal = Cell.Value
If CellVal < "" Then
Cell.Value = CellVal & Chr(10)
End If
Next
End Sub


--
Jim
"dfresh34" wrote in message
...
| Jim,
|
| I have basically the same question except I want to search every cell
under
| a column and find the end of text in that cell and insert a Alter-Enter.
I
| already knew how to do that with "Replace - Alt-0010", but what do I
search
| for to find the end of each line of text in that cell?
|
| This is urgent so any help would be helpful.
|
| "Jim Rech" wrote:
|
| You might try this macro. Select the range of concatenated cells and
run
| it.
|
| Sub a()
| Dim Cell As Range
| Dim CellVal As String
| For Each Cell In Selection
| CellVal = Cell.Value
| If CellVal < "" Then
| CellVal = Replace(CellVal, "by: ", Chr(10) & "by: ")
| CellVal = Mid(CellVal, 2) ''Don't add CR before first
comment
| Cell.Value = CellVal
| End If
| Next
| End Sub
|
|
| --
| Jim
| "o1darcie1o" wrote in message
| ...
| |I have a spreadsheet imported from an outside program. The program is
web
| | based, and has "cases" set up that cust. serv & sales people can
"comment"
| on
| | back & forth.
| | When it imports into excel, each comment for each case is an
individual
| row
| | (so for case 66222, there are 6 rows if there are 6 comments). What I
| need
| | to do is combine everything into 1 row.
| | I'm using the a1&b1&c1 to combine all the comments into one cell, but
at
| the
| | beginning of each comment, I want to insert a line break. Short of
| | individually going into each cell and entering one, is there any way
to do
| | it? Maybe an edit/replace type thing? I've set it up so each new
comment
| | begins with "by:". I can add a character to the beginning of that, and
| | replace it with something else, but I couldn't find anything about how
to
| add
| | the alt+enter line break.
| | Any ideas? Thanks in advance!
|
|
|





 
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
insert a row with enter on a specific cell Oakie Excel Discussion (Misc queries) 4 July 28th 06 05:22 PM
Why can't I get 'alt enter' to create a line break in Excel? babbott Excel Discussion (Misc queries) 3 May 9th 06 12:18 AM
How to insert line on other worksheet depending upon result in cell? Pheasant Plucker® Excel Discussion (Misc queries) 4 March 17th 06 09:05 AM
Auto Insert Rows of Data?? tojo107 Excel Discussion (Misc queries) 2 May 28th 05 09:28 PM
How do I insert a line break when using the CONCATENATE function? ShaneRuth Excel Worksheet Functions 2 November 5th 04 11:26 PM


All times are GMT +1. The time now is 03:49 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"