Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting line break within a row
Hi I have a text like this {"09/01/06 13:58:29 (esu,k):", "Request completed.", , "09/01/06 13:04:38 (p,e):", "add the role"} in a cell. I need to replace ", " with a single line break and ", , " with a double line break.This should all be within the same cell. The data in the cell should look like this. {"09/01/06 13:58:29 (esu,k): Request completed.Emailed user 09/01/06 13:04:38 (p, e): add the role "} within the same cell.. Please help |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting line break within a row
Try something along these lines:
ActiveCell = Replace(ActiveCell, ",", vbLf) -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: Hi I have a text like this {"09/01/06 13:58:29 (esu,k):", "Request completed.", , "09/01/06 13:04:38 (p,e):", "add the role"} in a cell. I need to replace ", " with a single line break and ", , " with a double line break.This should all be within the same cell. The data in the cell should look like this. {"09/01/06 13:58:29 (esu,k): Request completed.Emailed user 09/01/06 13:04:38 (p, e): add the role "} within the same cell.. Please help |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting line break within a row
It is throwing an error too few arguments.
wat does this vblf mean ? Can you help Charles Chickering wrote: Try something along these lines: ActiveCell = Replace(ActiveCell, ",", vbLf) -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: Hi I have a text like this {"09/01/06 13:58:29 (esu,k):", "Request completed.", , "09/01/06 13:04:38 (p,e):", "add the role"} in a cell. I need to replace ", " with a single line break and ", , " with a double line break.This should all be within the same cell. The data in the cell should look like this. {"09/01/06 13:58:29 (esu,k): Request completed.Emailed user 09/01/06 13:04:38 (p, e): add the role "} within the same cell.. Please help |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting line break within a row
I do not get that error. vbLf is the visual basic constant "Line Feed". Can
you post the code you are trying to run? What version of excel are you using? -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: It is throwing an error too few arguments. wat does this vblf mean ? Can you help Charles Chickering wrote: Try something along these lines: ActiveCell = Replace(ActiveCell, ",", vbLf) -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: Hi I have a text like this {"09/01/06 13:58:29 (esu,k):", "Request completed.", , "09/01/06 13:04:38 (p,e):", "add the role"} in a cell. I need to replace ", " with a single line break and ", , " with a double line break.This should all be within the same cell. The data in the cell should look like this. {"09/01/06 13:58:29 (esu,k): Request completed.Emailed user 09/01/06 13:04:38 (p, e): add the role "} within the same cell.. Please help |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting line break within a row
I just clicked on a cell and tried to replace with wat u gave me.
ActiveCell = Replace(ActiveCell, ", ", vbLf) It throws me an error too few arguments.Can you tell me how to use it? I am using excel2003 Thanks Charles Chickering wrote: I do not get that error. vbLf is the visual basic constant "Line Feed". Can you post the code you are trying to run? What version of excel are you using? -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: It is throwing an error too few arguments. wat does this vblf mean ? Can you help Charles Chickering wrote: Try something along these lines: ActiveCell = Replace(ActiveCell, ",", vbLf) -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: Hi I have a text like this {"09/01/06 13:58:29 (esu,k):", "Request completed.", , "09/01/06 13:04:38 (p,e):", "add the role"} in a cell. I need to replace ", " with a single line break and ", , " with a double line break.This should all be within the same cell. The data in the cell should look like this. {"09/01/06 13:58:29 (esu,k): Request completed.Emailed user 09/01/06 13:04:38 (p, e): add the role "} within the same cell.. Please help |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting line break within a row
You can't use this in a cell. Charles provided a vba solution. You
would have to insert this in code to make your replacements. Kamini wrote: I just clicked on a cell and tried to replace with wat u gave me. ActiveCell = Replace(ActiveCell, ", ", vbLf) It throws me an error too few arguments.Can you tell me how to use it? I am using excel2003 Thanks Charles Chickering wrote: I do not get that error. vbLf is the visual basic constant "Line Feed". Can you post the code you are trying to run? What version of excel are you using? -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: It is throwing an error too few arguments. wat does this vblf mean ? Can you help Charles Chickering wrote: Try something along these lines: ActiveCell = Replace(ActiveCell, ",", vbLf) -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: Hi I have a text like this {"09/01/06 13:58:29 (esu,k):", "Request completed.", , "09/01/06 13:04:38 (p,e):", "add the role"} in a cell. I need to replace ", " with a single line break and ", , " with a double line break.This should all be within the same cell. The data in the cell should look like this. {"09/01/06 13:58:29 (esu,k): Request completed.Emailed user 09/01/06 13:04:38 (p, e): add the role "} within the same cell.. Please help |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting line break within a row
I assumed that you wanted to do this with code, this is the line you would
need to use in a macro to replace a "," in the activecell with a line feed. To create a macro, open excel, then press Alt + F11. Go to the menu item "Insert" then choose "Module". Paste this code into the code area: Sub ReplaceCommas() Dim C As Range For Each C In Selection.Cells C = Replace(C, ",", vbLf) Next End Sub To run this, Open the workbook that you want to Find/Replace. Then select the range that you want to replace commas from. Then press Alt + F8. For the "Macros In:" ComboBox, Choose "All Open Workbooks" Then choose the macro "ReplaceCommas" and click run. -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: I just clicked on a cell and tried to replace with wat u gave me. ActiveCell = Replace(ActiveCell, ", ", vbLf) It throws me an error too few arguments.Can you tell me how to use it? I am using excel2003 Thanks Charles Chickering wrote: I do not get that error. vbLf is the visual basic constant "Line Feed". Can you post the code you are trying to run? What version of excel are you using? -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: It is throwing an error too few arguments. wat does this vblf mean ? Can you help Charles Chickering wrote: Try something along these lines: ActiveCell = Replace(ActiveCell, ",", vbLf) -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: Hi I have a text like this {"09/01/06 13:58:29 (esu,k):", "Request completed.", , "09/01/06 13:04:38 (p,e):", "add the role"} in a cell. I need to replace ", " with a single line break and ", , " with a double line break.This should all be within the same cell. The data in the cell should look like this. {"09/01/06 13:58:29 (esu,k): Request completed.Emailed user 09/01/06 13:04:38 (p, e): add the role "} within the same cell.. Please help |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting line break within a row
Choose Edit|Replace with find set to ", " and in the replace box enter
ctrl+j or ALT+0010 for a line feed. (press right arrow and backspace to erase it) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Alt + enter is not inserting a line break within a cell in Excel? | Excel Worksheet Functions | |||
inserting line break with find and replace. | Excel Programming | |||
Break cell into multiple lines by line break | Excel Discussion (Misc queries) | |||
Inserting A row & page break | Excel Programming | |||
inserting break in code | Excel Programming |