View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.programming
Kamini Kamini is offline
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