|
楼主 |
发表于 2003-8-14 19:13
|
显示全部楼层
文件怎样才能上传![em02][em02]现循环程序如下:dp_num = WorksheetFunction.CountA(Worksheets("5031及部门").Range("9:9"))
For x = 3 To dp_num + 2
Sheets("中间排序").Cells(x, 1) = curr_num '每行币种 e.g. 14
Sheets("中间排序").Cells(x, 2) = WorksheetFunction.VLookup(curr_num, Worksheets("货币符号").Range("货币区"), 2, 0) '每行货币符号 e.g. USD
Sheets("中间排序").Cells(x, 3) = WorksheetFunction.VLookup(curr_num, Worksheets("货币符号").Range("货币区"), 3, 0) '每行货币名称
Sheets("中间排序").Cells(x, 4) = Sheets("5031及部门").Cells(9, x) '每行部门名称
Sheets("中间排序").Cells(x, 5) = Sheets("5031及部门").Cells(10, x) '每行部门代码
Sheets("中间排序").Cells(x, 6) = Round(Sheets("输入").Cells(curr_num, x + 1), 2) '每行小写金额
Sheets("中间排序").Cells(x, 7) = Sheets("5031及部门").Cells(curr_num, x) '每行帐号
Next x
Application.Run "'555.xls'!排序" ‘简单的从大到小排序
' Sheets("输入").Select
'打印格式
pr_num = WorksheetFunction.CountA(Worksheets("中间排序").Range("f3:f25")) - WorksheetFunction.CountIf(Worksheets("中间排序").Range("F3:F25"), 0)
i = 0
Line1:
Do While i <= pr_num - 1
dx = Sheets("中间排序").Cells(3 + i, 11) '大写金额
m1 = Sheets("中间排序").Cells(3 + i, 2) '货币符号
len_num = Sheets("中间排序").Cells(3 + i, 10) '长度
money_num = Sheets("中间排序").Cells(3 + i, 6) * 100 '小写金额
Sheets("打印表").Cells(6, 22) = money_num - Int(money_num / 10) * 10 '分位数
'各个位数分别填入数字
For Y = 1 To len_num - 1
Sheets("打印表").Cells(6, 30 - Y) = Int(money_num / 10 ^ Y) - Int(money_num / 10 ^ (Y + 1)) * 10
Next Y
'余格清空
z = 11 - len_num
For mm = 1 To z
Sheets("打印表").Cells(6, 19 + mm) = ""
Next mm
Sheets("打印表").Cells(6, 30 - len_num) = m1
Sheets("打印表").Select
pg = i + 1
pg = Str(pg)
Sheets("打印表").Cells(11, 31) = pg
Response = MsgBox("此次打印共" + Str(pr_num) + "页" + Chr(10) + "现第" + pg + "页", 1)
If Response = 2 Then
MsgBox "本页不打印"
i = i + 1
GoTo Line1
End If
Sheets("打印表").PrintOut
i = i + 1
Loop
指教一二
[em19][em19] |
|