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 |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting line break within a row
Hi
I am getting the result with " at all places it inserted line feed Please help how i can fix this Charles Chickering wrote: 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 |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting line break within a row
Just change the "," with ", " that should fix it. If you need to put it back
the way it was, then change the "," to vbLf and change the vbLf to "," -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: Hi I am getting the result with " at all places it inserted line feed Please help how i can fix this Charles Chickering wrote: 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 |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting line break within a row
yeah i did that.
This is the result {"09/01/06 13:58:29 (esu,k):" "Request completed." "09/01/06 13:04:38 (p,e):" "add the role"} Now i want to replace teh " with nothing..how dod i do it.? Thanks Kamini Charles Chickering wrote: Just change the "," with ", " that should fix it. If you need to put it back the way it was, then change the "," to vbLf and change the vbLf to "," -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: Hi I am getting the result with " at all places it inserted line feed Please help how i can fix this Charles Chickering wrote: 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 |
#12
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting line break within a row
Ah!!! Light dawns on yon marble head... you want to replace the actual
quotation marks. I feel stupid now. anyhow try this: C = Replace(C, Chr(34) & ", " & Chr(34), vbLf) C = Replace(C, Chr(34) & ", , " & Chr(34), vbLf) -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: yeah i did that. This is the result {"09/01/06 13:58:29 (esu,k):" "Request completed." "09/01/06 13:04:38 (p,e):" "add the role"} Now i want to replace teh " with nothing..how dod i do it.? Thanks Kamini Charles Chickering wrote: Just change the "," with ", " that should fix it. If you need to put it back the way it was, then change the "," to vbLf and change the vbLf to "," -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: Hi I am getting the result with " at all places it inserted line feed Please help how i can fix this Charles Chickering wrote: 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 |
#13
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) |
#14
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting line break within a row
Nah i should have explained better,
Now i got it..great ..thanks a Lot!!! Charles Chickering wrote: Ah!!! Light dawns on yon marble head... you want to replace the actual quotation marks. I feel stupid now. anyhow try this: C = Replace(C, Chr(34) & ", " & Chr(34), vbLf) C = Replace(C, Chr(34) & ", , " & Chr(34), vbLf) -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: yeah i did that. This is the result {"09/01/06 13:58:29 (esu,k):" "Request completed." "09/01/06 13:04:38 (p,e):" "add the role"} Now i want to replace teh " with nothing..how dod i do it.? Thanks Kamini Charles Chickering wrote: Just change the "," with ", " that should fix it. If you need to put it back the way it was, then change the "," to vbLf and change the vbLf to "," -- Charles Chickering "A good example is twice the value of good advice." "Kamini" wrote: Hi I am getting the result with " at all places it inserted line feed Please help how i can fix this Charles Chickering wrote: 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 |
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 |