开发者

how to put line break in excel sheet cell [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improv开发者_StackOverflow中文版e this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

I've so many rows in database table and i want it to be exported in excel sheet. My each row represent an individual sale, this sale may contain one or more product and if there is more than one product i'm showing it like this

how to put line break in excel sheet cell [closed]

above image represent my single row that contain more than one product for a sale.

when i convert the whole recode into excel both product code no are shown as a joined string, But i want to put the line break in excel sheet cell. how can i put the line break in excel sheet programmaticaly.


You can put line break using \n in excel sheet. if you want to switch to another cell in same row then you can achieve it by ','...

something like this

$data  = $row['fname']." ".$row['lname'].",";
$data .= $row['programEnrollments'][0]['startSessionName'].",\n";


If you're exporting XML code to generate your Excel file, you would need to use PageBreaks


Vikas,

Am I right, that you want to know how to use the replace function with Chr(10)?

Something like:

Application.Calculation = xlCalculationManual

Dim SpecialChar

SpecialChar = Chr(10)

Cells.Replace What:=SpecialChar, Replacement:=" ", SearchOrder:=xlByColumns, MatchCase:=True

Application.Calculation = xlCalculationAutomatic

Regards,

Robert Ilbrink

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜