| 一篇关于客户端用ASP+rds+VBA参生报表的好东东(高级篇) |
| 作者:佚名 文章来源:不详 点击数: 更新时间:2007-2-14 14:58:01 |
|
.Cells(RowCnt-3, 2).Value = "THE JOB INFORMATION TABLE" .Cells(RowCnt-3, 3).Value = date() .Cells(RowCnt-4, 3).Value = "The "+trim(PageNo)+"/"+trim(TotalPageCnt) +" Pages" end with 'Format the title field name of cells With xlSheet1 .range("A"+trim(RowCnt) +":B"+trim(RowCnt)).merge .range("A"+trim(RowCnt+1) +":A"+trim(RowCnt+2)).merge .range("B"+trim(RowCnt+1) +":B"+trim(RowCnt+2)).merge .range("C"+trim(RowCnt) +":D"+trim(RowCnt)).merge .range("C"+trim(RowCnt+1) +":C"+trim(RowCnt+2)).merge .range("D"+trim(RowCnt+1) +":D"+trim(RowCnt+2)).merge .Cells(RowCnt, 1).Value = "The job" .Cells(RowCnt+1,1).Value = "job_id" .Cells(RowCnt+1,2).Value = "job_desc" .Cells(RowCnt, 3).Value = "Level" .Cells(RowCnt+1,3).Value = "Max level" .Cells(RowCnt+1,4).Value = "Min level" End With RowCnt=int(RowCnt)+3 PageNo=PageNo+1 end sub
sub foot_title() dim FootRow FootRow=1 do while FootRow<= FootRowCnt With xlSheet1 .range("C"+trim(RowCnt)+":"+"D"+trim(RowCnt)).merge end with RowCnt=RowCnt+1 FootRow=FootRow+1 loop With xlSheet1 .Cells(RowCnt-1, 1).Value = "A:" .Cells(RowCnt-1, 2).Value = "B:" .Cells(RowCnt-1, 3).Value = "C:" end with end sub
sub format_grid() dim strCode dim MyMacro strCode = _ "sub MyMacro() " & vbCr & _ "dim HeadRowCnt" & vbCr & _ "dim TitleRowCnt" & vbCr & _ "dim ContentRowCnt" & vbCr & _ "dim FootRowCnt" & vbCr & _ "dim PageRowCnt" & vbCr & _ "dim BgnCnt" & vbCr & _ "HeadRowCnt="& HeadRowCnt &"" & vbCr & _ "TitleRowCnt="& TitleRowCnt &"" & vbCr & _ "ContentRowCnt="& ContentRowCnt &"" & vbCr & _ "FootRowCnt="& FootRowCnt &"" & vbCr & _ "PageRowCnt=HeadRowCnt+TitleRowCnt+ContentRowCnt+FootRowCnt" & vbCr & _ "BgnCnt=1" & vbCr & _ "PageNo=1" & vbCr & _ "Range(""A""+trim(BgnCnt)+"":D""+trim(BgnCnt)).Select" & vbCr & _ "With sheet1" & vbCr & _ " .Range(""A1"").ColumnWidth = "& ColumnAWidth&"" & vbCr & _ " .Range(""B1"").ColumnWidth = "& ColumnBWidth&"" & vbCr & _ " .Range(""C1"").ColumnWidth = "& ColumnCWidth&"" & vbCr & _ " .Range(""D1"").ColumnWidth = "& ColumnDWidth&"" & vbCr & _ "End With" & vbCr & _ "do while PageNo<= "& TotalPageCnt&"" & vbCr & _ "if PageNo= "& TotalPageCnt& " then" & vbCr & _ " ContentRowCnt="& ContentRowNowCnt &"" & vbCr & _ " PageRowCnt=HeadRowCnt+TitleRowCnt+ContentRowCnt+FootRowCnt" & vbCr & _ "end if" & vbCr & _ "Range(""A""+trim(BgnCnt)+"":D""+trim(BgnCnt+PageRowCnt-1)).Select" & vbCr & _ "With Range(""A""+trim(BgnCnt)+"":D""+trim(BgnCnt+PageRowCnt-1))" & vbCr & _ " .Borders.LineStyle = xlContnuous" & vbCr & _ " .Borders.Weight = xlThin" & vbCr & _ " .Borders.ColorIndex = 10" & vbCr & _ " .RowHeight = 15" & vbCr & _ " .VerticalAlignment = xlCenter" & vbCr & _ " .HorizontalAlignment = xlLeft" & vbCr & _ " .Font.Size = 9" & vbCr & _ "End With" & vbCr & _ "With Range(""A""+trim(BgnCnt)+"":D""+trim(BgnCnt+HeadRowCnt-1))" & vbCr & _ " .Font.Size = 11" & vbCr & _ " .Font.Bold = True" & vbCr & _ " .Borders.LineStyle = xlLineStyleNone" & vbCr & _ " .VerticalAlignment = xlCenter" & vbCr & _ " .HorizontalAlignment = xlCenter" & vbCr & _ " .Orientation = xlHorizontal" & vbCr & _ "End With" & vbCr & _ "With Range(""A""+trim(BgnCnt+HeadRowCnt)+"":D""+trim(BgnCnt+HeadRowCnt+TitleRowCnt-1))" & vbCr & _ " .WrapText = True" & vbCr & _ " .Font.Size = 9" & vbCr & _ " .Font.Bold = True" & vbCr & _ " .VerticalAlignment = xlCenter" & vbCr & _ " .HorizontalAlignment = xlCenter" & vbCr & _ " .Orientation = xlHorizontal" & vbCr & _ "end With" & vbCr & _ "With Range(""A""+trim(BgnCnt+HeadRowCnt+TitleRowCnt+ContentRowCnt)+"":D""+trim(BgnCnt+HeadRowCnt+TitleRowCnt+ContentRowCnt+FootRowCnt-1))" & vbCr & _ " .Font.Size = 9" & vbCr & _ " .Font.Bold = True" & vbCr & _ " .Borders.LineStyle = xlLineStyleNone" & vbCr & _ " .VerticalAlignment = xlCenter" & vbCr & _ " .HorizontalAlignment = xlLeft" & vbCr & _ " .Orientation = xlHorizontal" & vbCr & _ "end With" & vbCr & _ "PageNo=PageNo+1" & vbCr & _ "BgnCnt=BgnCnt+PageRowCnt" & vbCr & _ "loop" & vbCr & _ "With Sheet1.PageSetup" & vbCr & _ " .HeaderMargin = application.CentimetersToPoints(0)" & vbCr & _ " .LeftMargin = application.CentimetersToPoints(2)" & vbCr & _ " .RightMargin =application.CentimetersToPoints(2)" & vbCr & _ " .TopMargin = application.CentimetersToPoints(1)" & vbCr & _ " .BottomMargin = application.CentimetersToPoints(1)" & vbCr & _ " .FooterMargin = application.CentimetersToPoints(0)" & vbCr & _ "' &nbs上一页 [1] [2] [3] 下一页
|
|
| 网站技术录入:admin 责任编辑:admin |
|
上一篇网站技术: 使用数据库判断在线名单以及在线人数 下一篇网站技术: 又一种在线人数统计方法(只用1个APPLICATION,原创) |
| 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |
网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
|
|
|
|
|
关于公司 | 免责声明 | 广告服务 | 招贤纳士 | 联系我们 | 友情链接 | 网站地图 1 2 3 Copyright@2005 - 2006 http://www.GXF.com.cn All Right Reserved 桂ICP备06002242号
|