ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   inserting line break within a row (https://www.excelbanter.com/excel-programming/375304-inserting-line-break-within-row.html)

Kamini

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


Charles Chickering

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



Kamini

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




Charles Chickering

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





Kamini

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






[email protected]

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






Charles Chickering

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







Kamini

inserting line break within a row
 
Yeah it worked .Thanks a lot
But witha small problem
All it did was to replace teh comma with the line break.
but i wanted it to replace the ", "

Thanks
Kamini

wrote:
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






Kamini

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








Charles Chickering

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









Kamini

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










Charles Chickering

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











Lori

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)


Kamini

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













All times are GMT +1. The time now is 09:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com