rajneetbhatia
asked on
Wrap text in Excel
Hi,
I am generating an Excel sheet pragramatically. Please let me know how can I wrap the text in Excel cell. Presently, if the text is more, it is coming in one line, without wrapping.
Waiting for reply.
Regards,
R S
I am generating an Excel sheet pragramatically. Please let me know how can I wrap the text in Excel cell. Presently, if the text is more, it is coming in one line, without wrapping.
Waiting for reply.
Regards,
R S
ASKER
Hi Scott,
In my case, I am not giving name to a range. How can I use it without range?
Thanks,
R S
In my case, I am not giving name to a range. How can I use it without range?
Thanks,
R S
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Scott,
I am generating Excel programatically based on the data in the database. If the data is more, it is wrapping in HTML(browser), but when I export it to excel, it is coming in same line.
I want to have the data in excel in the same way as it is coming in word or browser. If you want I can give a name to the TD.
Thanks,
R S
I am generating Excel programatically based on the data in the database. If the data is more, it is wrapping in HTML(browser), but when I export it to excel, it is coming in same line.
I want to have the data in excel in the same way as it is coming in word or browser. If you want I can give a name to the TD.
Thanks,
R S
Hi R S
I think it would help if you could post the code you are using to generate the excel. From there we can see what you are doing and how best to help.
Regards
Scott
I think it would help if you could post the code you are using to generate the excel. From there we can see what you are doing and how best to help.
Regards
Scott
Not sure if this is what you need but ...
Highlight the cells, then
Format > cells
Click the 'alignment' tab
click 'Wrap text'
Michael
Highlight the cells, then
Format > cells
Click the 'alignment' tab
click 'Wrap text'
Michael
ASKER
"I think it would help if you could post the code you are using to generate the excel. From there we can see what you are doing and how best to help.
"
Hi,
I am writing following two lines in my java code, which asks me to open or save in excel, and thus I am able to save my html generated code into excel.
response.setContentType("a pplication /vnd.ms-ex cel");
response.setHeader("Conten t-disposit ion", "attachment;filename=a.xls ");
Thanks,
R S
"
Hi,
I am writing following two lines in my java code, which asks me to open or save in excel, and thus I am able to save my html generated code into excel.
response.setContentType("a
response.setHeader("Conten
Thanks,
R S
put the content in quotes if it's a CSV:
"this content
should wrap
in excel"
if you're using html, use "<BR>" tags instead of linebreaks.
or use chr(10) or chr(13) instead of linebreaks
"this content
should wrap
in excel"
if you're using html, use "<BR>" tags instead of linebreaks.
or use chr(10) or chr(13) instead of linebreaks
sample:
<table>
<tr>
<td style="height:100%;width:5 0px;">test
test
test
test
test<br />
</td>
</tr>
</table>
<table>
<tr>
<td style="height:100%;width:5
test
test
test
test<br />
</td>
</tr>
</table>
You can wrap the text in a cell by setting the .WrapText property of the cell to True
so for example
Range("A1").WrapText = True
Regards
Scott