解决方案 »
- DataFormats.FileDrop文件格式是什么文件!?
- 如何解除 datatable间的关联。
- 用C# 编写的WINFORM 程序在运行到弹出窗体时打不开,自动关闭,为什么?
- asp.net简单的问题!! 不回的也来看一看啊
- 哪里有关于C#中类体系的结构图?
- 如何弹出一个对话框,带ok和cancel按钮
- 关于ReportServices急呀!!!!!!!!!!!!!!!!
- 何为ActiveX控件在c#中如何使用
- 有关贴子的本地保存
- 结盟在深圳的.NET程序员!
- objectdatasource 的 SelectMethod 中如何读取 master page 中下拉框的值
- 如何用C#实现tiff文件的CCITT Group4压缩
Range("A2:L2").Select
Application.WindowState = xlMinimized
Application.WindowState = xlNormal
Range("A2:L2").Select
ActiveCell.FormulaR1C1 = _
"华洪珠宝首饰有限公司客户产品出货单" & Chr(10) & "送货单位:润邦迈李饰品 NO:55094 2013.12.10"
With ActiveCell.Characters(Start:=1, Length:=0).Font
.Name = "宋体"
.FontStyle = "加粗"
.Size = 22
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.Color = -16777216
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
With ActiveCell.Characters(Start:=1, Length:=17).Font
.Name = "宋体"
.FontStyle = "加粗"
.Size = 14
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.Color = -16777216
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
With ActiveCell.Characters(Start:=18, Length:=6).Font
.Name = "宋体"
.FontStyle = "加粗"
.Size = 22
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.Color = -16777216
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
With ActiveCell.Characters(Start:=24, Length:=7).Font
.Name = "宋体"
.FontStyle = "加粗"
.Size = 22
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.Color = -16776961
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
With ActiveCell.Characters(Start:=31, Length:=30).Font
.Name = "宋体"
.FontStyle = "加粗"
.Size = 22
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.Color = -16777216
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
Range("G6").Select
End Sub
但是完全不知道怎么照样写,求指导一下,就我说的效果,帮我写一个例子!万分感谢!!
自己看
自己看
这个我知道,这种方法是把单元格作为一个整体来进行操作的,比如加粗会把整个单元格的所有文字加粗,但我现在要的是把单元格内指定的某个字加粗而已···
HSSFSheet sheet = workbook.CreateSheet(strFileNamet);
try
{
#region 创建标题行及其相关的样式
HSSFRow titleRow = sheet.CreateRow(0);
titleRow.HeightInPoints = 30; //行高
titleRow.CreateCell(0).SetCellValue(strHeaderText);//标题名
HSSFCellStyle titleCellStyle = workbook.CreateCellStyle(); //标题单元格样式
//标题字体样式
HSSFFont titleFont = workbook.CreateFont();
titleFont.FontName = "宋体";
titleFont.FontHeightInPoints = 22;
titleFont.Boldweight = 700;
//设置标题行的样式
titleCellStyle.SetFont(titleFont);
titleCellStyle.Alignment = CellHorizontalAlignment.CENTER;
titleCellStyle.VerticalAlignment = CellVerticalAlignment.CENTER;
titleRow.GetCell(0).CellStyle = titleCellStyle;
sheet.AddMergedRegion(new Region(0, 0, 0, 10));//合并
#endregion