Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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





  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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
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 is not inserting a line break within a cell in Excel? Mattwpaul Excel Worksheet Functions 1 November 8th 07 06:22 PM
inserting line break with find and replace. Kamini Excel Programming 0 October 16th 06 08:23 PM
Break cell into multiple lines by line break Chia Excel Discussion (Misc queries) 1 August 20th 06 06:37 AM
Inserting A row & page break Jamie Excel Programming 1 June 13th 06 06:09 PM
inserting break in code papa jonah Excel Programming 4 December 22nd 05 01:20 AM


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