Office中国论坛/Access中国论坛
标题:
[原创]双行标题工资条打印
[打印本页]
作者:
fjzjyan
时间:
2007-1-23 05:07
标题:
[原创]双行标题工资条打印
按Alt+F11进入VBE界面,插入一个模块并在其中编写如下代码后加载到一个窗体控件的命令按钮
Sub pgzt()
Dim n As Integer
Dim i As Integer
Dim j As Integer
n = gzb.[a1].CurrentRegion.Rows.Count
gzb.[a1].CurrentRegion.Copy gzt.[a1]
For i = 3 To 3 * n Step 3
gzt.Rows(i + 1).Insert
gzt.Rows(i + 2).Insert
Next i
For j = 4 To 3 * n Step 3
gzt.[a1:w2].Copy gzt.Cells(j, 1)
Next j
End Sub
备注:此源码来自本人自行编写《EXCEL VBA+Access开发》课程教学讲义。[attach]22771[/attach]
[此贴子已经被作者于2007-5-17 11:17:48编辑过]
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/)
Powered by Discuz! X3.3