Sub Init()
Cells.Select
With Selection.Font
.Name = "宋体" '要附的变量
.Size = 9 '要附的变量
End With
With Application
.ReferenceStyle = xlR1C1 'col use char or xltoright is use number
.Selection.CurrentRegion.Columns.AutoFit
.Selection.CurrentRegion.Rows.AutoFit
End With
Columns("A:B").Select
Selection.NumberFormatLocal = "@" '文本格式
With ActiveCell.Characters(Start:=1, Length:=4).Font
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
End Sub
我想用VB控制EXCEL的的字体,VB可否传变量给EXCEL中的宏??哪位用过阿?
Cells.Select
With Selection.Font
.Name = "宋体" '要附的变量
.Size = 9 '要附的变量
End With
With Application
.ReferenceStyle = xlR1C1 'col use char or xltoright is use number
.Selection.CurrentRegion.Columns.AutoFit
.Selection.CurrentRegion.Rows.AutoFit
End With
Columns("A:B").Select
Selection.NumberFormatLocal = "@" '文本格式
With ActiveCell.Characters(Start:=1, Length:=4).Font
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
End Sub
我想用VB控制EXCEL的的字体,VB可否传变量给EXCEL中的宏??哪位用过阿?
解决方案 »
- 如果用VB获取对话框的内容,,,求救~~!!!
- 如何将TreeView与Combo绑定 使TreeView内嵌在Combo里
- vb如何将数据写成word表格文档
- 急....如何判断硬键盘输入和软键盘输入!!!
- winsock发送和接收数据包正常,但接收不到trap数据包???
- 送粉啦
- 请教关于MODEM的问题?
- 另开一贴:请问在datagrid控件中,如何实现日期,数字的排序!如何实现升序或降序!
- vb支持多线程吗?请问我这个问题该如何解决?
- VB 在 text1输入内容(5位数以下),判断是否含有字母或者别的符号,有就出现提示:“抱歉,请输入纯数字”
- 关于对USB口的操作
- ActiveReport2 如何放大设计?
dim vba_size as integer sub form_load()
vba_name ="宋体"
vba_size =9
end sub.....................
With Selection.Font
.Name = vba_name '要附的变量
.Size = vba_size '要附的变量
End With
xlsheet.Activate '激活工作表
xlBook.RunAutoMacros (xlAutoOpen) '运行EXCEL中的启动宏
我想只要设好所有的值后,把所有的任务交给宏来完成
CreateObject("Scripting.FileSystemObject") 取出TXT 中的变量.