VBA:考场场标打印
Function pda(x)
a = x
If Len(a) = 1 Then
ab = "00" & a
ElseIf Len(a) = 2 Then
ab = "0" & a
Else
ab = a End If
pda = ab
End Function
Sub yy()
Worksheets.Select
With ActiveSheet.PageSetup .LeftMargin = Application.CentimetersToPoints(0.5) .RightMargin = Application.CentimetersToPoints(0.5) .TopMargin = Application.CentimetersToPoints(2.5) '顶边距
.Orientation = xlLandscape '纵向 xlPortait横向 .BottomMargin = Application.CentimetersToPoints(1) '底 .HeaderMargin = Application.CentimetersToPoints(0.5) '页眉 .FooterMargin = Application.CentimetersToPoints(0.5) '页脚 .Zoom = 100 End With
End Sub
Sub yya()
For Each sh In ThisWorkbook.Sheets With sh
With .PageSetup
.TopMargin = Application.CentimetersToPoints(2.5) '顶边距 .CenterHorizontally = True '水平居中
.CenterVertically = True '垂直居中
.Orientation = xlLandscape '横向打印 End With
End With
Next
End Sub
Public Sub shanchu()
Application.DisplayAlerts = False '关闭警告信息显示
Dim i As Integer For i = Sheets.Count To 1 Step -1
Debug.Print Sheets(i).Name
If Sheets(i).Name <> "Sheet1" Then
Sheets(i).Delete
End If
Next
End Sub
Sub pd()
n = Worksheets.Count
Dim i As Integer
Dim xx As Integer
Dim yy As Integer
Dim mm As Integer
Rem xx为每个考场的人数
Rem yy为当前专业标记
Rem mm为当前专业考生人数
Rem shu为当前专业考号张数
Rem shuu为当前专业考场数量
xx = 45
yy = 2002
mm = 889
If Int(mm / xx) = mm / xx Then
shuu = mm / xx
ElseIf Int(mm / xx) <> mm / xx Then
shuu = Int(mm / xx) + 1
End If
If Int(mm / xx) = mm / xx Then
shu = mm / xx
ElseIf Int(mm / xx) <> mm / xx Then
shu = Int(mm / xx) + 1
End If For i = 1 To shuu
Sheets.Add after:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = "机" & i Next
If yy = 2007 Then
mc = "裴竞考场"
ElseIf yy = 2001 Then
mc = "机电考场"
ElseIf yy = 2002 Then
mc = "计算机考场"
ElseIf yy = 2003 Then
mc = "会计考场"
ElseIf yy = 2004 Then
mc = "学前考场"
ElseIf yy = 2005 Then
mc = "电商考场"
ElseIf yy = 2006 Then
mc = "汽修考场"
ElseIf yy = 2008 Then
mc = "航空考场"
ElseIf yy = 2009 Then
mc = "轨道考场"
ElseIf yy = 2010 Then
mc = "电力考场"
End If bz = 0
For i = 1 To shuu
Worksheets(i).Activate ab = pda((i * xx - xx) + 1) ab1 = pda((i * xx))
If ab1 >= mm Then
If i = shuu Then
ab1 = mm
End If
End If Rows("1:1").RowHeight = 171.75
Rows("2:2").RowHeight = 123.75
Columns("A:A").ColumnWidth = 130.5
Range("A1:c10").Font.Name = "宋体"
Range("A1:c10").Font.Bold = True
Range("A1:A1").Font.Size = 90
Range("A2:A2").Font.Size = 60
Range("A1:a2").HorizontalAlignment = xlCenter
If i = shuu And i = 1 Then Range("a" & 1) = mc Else
Range("a" & 1) = mc & i
End If
abb = ab
Range("a" & 2) = "(" & yy & ab & " - " & yy & ab1 & ")" Next
For Each sh In ThisWorkbook.Sheets With sh
With .PageSetup
.TopMargin = Application.CentimetersToPoints(2.5) '顶边距 .CenterHorizontally = True '水平居中
.CenterVertically = True '垂直居中
.Orientation = xlLandscape '横向打印 End With
End With
Next
End Sub
Sub pdda()
n = Worksheets.Count
Dim i As Integer
Dim xx As Integer
Dim yy As Integer
Dim mm As Integer
Rem xx为每个考场的人数
Rem yy为当前专业标记
Rem mm为当前专业考生人数
Rem shu为当前专业考号张数
Rem shuu为当前专业考场数量
xx = 45
yy = 2002
mm = 889
If Int(mm / xx) = mm / xx Then
shuu = mm / xx
ElseIf Int(mm / xx) <> mm / xx Then
shuu = Int(mm / xx) + 1
End If
If Int(mm / xx) = mm / xx Then
shu = mm / xx
ElseIf Int(mm / xx) <> mm / xx Then
shu = Int(mm / xx) + 1
End If For i = 1 To shuu
Sheets.Add after:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = "计" & i Next
If yy = 2007 Then
mc = "裴竞考场"
ElseIf yy = 2001 Then
mc = "机电考场"
ElseIf yy = 2002 Then
mc = "计算机考场"
ElseIf yy = 2003 Then
mc = "会计考场"
ElseIf yy = 2004 Then
mc = "学前考场"
ElseIf yy = 2005 Then
mc = "电商考场"
ElseIf yy = 2006 Then
mc = "汽修考场"
ElseIf yy = 2008 Then
mc = "航空考场"
ElseIf yy = 2009 Then
mc = "轨道考场"
ElseIf yy = 2010 Then
mc = "电力考场"
End If bz = 0
For i = 2 To shuu
Worksheets(i).Activate ab = pda((i * xx - xx) + 1) ab1 = pda((i * xx))
If ab1 >= mm Then
If i = shuu Then
ab1 = mm
End If
End If Rows("1:1").RowHeight = 171.75
Rows("2:2").RowHeight = 123.75
Columns("A:A").ColumnWidth = 130.5
Range("A1:c10").Font.Name = "宋体"
Range("A1:c10").Font.Bold = True
Range("A1:A1").Font.Size = 90
Range("A2:A2").Font.Size = 60
Range("A1:a2").HorizontalAlignment = xlCenter
If i = shuu And i = 1 Then Range("a" & 1) = mc Else
Range("a" & 1) = mc & i
End If
abb = ab
Range("a" & 2) = "(" & yy & ab & " - " & yy & ab1 & ")"
With ActiveSheet.PageSetup
.TopMargin = Application.CentimetersToPoints(2.5) '顶边距
.CenterHorizontally = True '水平居中
.CenterVertically = True '垂直居中
.Orientation = xlLandscape '横向打印 End With
Next End Sub
VBA:考场场标打印的更多相关文章
- EXCEL:宏 考场考号打印
Sub addwork() Rem 当前宏是根据学生数量 .每考场人数计算工作表数Dim i As IntegerRem xx为每个考场的人数Rem yy为当前专业标记Rem mm为当前专业考生人数R ...
- 利用vba实现excel表格连接打印编号(一页两个编号),编号支持前缀
先看一下excel文件, 下图左边部分为文件签审单为要打印的内容, 要求一页需要打印两个文件签审单, NO需要根据打印页面连续编号, 右边部分为打印设置,以及vba部分代码展示, 打印设置可以设置打印 ...
- tshark----wireshark的命令行工具
tshark - 转储和分析网络流 概要 tshark的 [ -2 ] [ -a <捕捉自动停止条件>] ... [ -b <捕捉环形缓冲区选项>] ... [ ...
- Go语言基础知识总结(持续中)
Go基础知识总结 变量声明 Go语言中的变量需要声明以后才可以使用(需要提前定义变量)并且声明后必须使用(不适用会报错) 标准声明 var 变量名 变量类型 example: var name str ...
- excel vba 打印设置(转)
FROM: http://hi.baidu.com/kdlipm/blog/item/0897dd16ffc03e59f3de32ab.html PageSetup 函式就會記錄時, 設定的記錄三個部 ...
- VBA 打印设置相关属性及方法
打印设置说明,以下均为默认值. With ActiveSheet.PageSetup .PrintTitleRows = "" '工作表打印标题:顶端标题行(R) .PrintTi ...
- VBA 打印及破密
Sub 打印()ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=TrueCall dyEnd SubSub dy()Dim a%, b ...
- VBA Excel 打印
1. 设置 页边距.打印区域 With .PageSetup .HeaderMargin = Application.CentimetersToPoints(0.5) .LeftMargin = Ap ...
- PACM Team(牛客第三场多校赛+dp+卡内存+打印路径)
题目链接(貌似未报名的不能进去):https://www.nowcoder.com/acm/contest/141/A 题目: 题意:背包题意,并打印路径. 思路:正常背包思路,不过五维的dp很容易爆 ...
随机推荐
- Vue的常用特性
Vue的常用特性 一.表单基本操作 都是通过v-model 单选框 1. 两个单选框需要同时通过v-model 双向绑定 一个值 2. 每一个单选框必须要有value属性 且value值不能一样 3. ...
- CVPR2019:无人驾驶3D目标检测论文点评
CVPR2019:无人驾驶3D目标检测论文点评 重读CVPR2019的文章,现在对以下文章进行点评. Stereo R-CNN based 3D Object Detection for Autono ...
- 如何在Python中加速信号处理
如何在Python中加速信号处理 This post is the eighth installment of the series of articles on the RAPIDS ecosyst ...
- 单目摄像头检测6D姿态
单目摄像头检测6D姿态 CVPR2019: ROI-10D: Monocular Lifting of 2D Detection to 6D Pose and Metric Shape 论文链接: h ...
- windows 设置nginx开机自启动
将Nginx设置为Windows服务 需要借助"Windows Service Wrapper"小工具,项目地址: https://github.com/kohsuke/winsw ...
- C语言数组初始化方式
//一维数组初始化//初始化方法1 int arr[5] = {3,7,2,1,9}; //定义了一个长度是5的数组,并给每个元素赋值 //初始化方法2 int arr[5] = {3,7}; //给 ...
- Django基础之自定义分页器
自定义分页器 针对批量插入的数据,我们在前端展示的时候发现一个很严重的问题,一页展示了所有的数据,数据量太大,查看不方便 针对数据量大但又需要全部展示给用户观看的情况下,我们统一做法都是做分页处理 分 ...
- 618技术特辑(三)直播带货王,“OMG买它”的背后,为什么是一连串技术挑战?
[本期推荐]为什么一到大促,我们的钱包总是被掏空?是大家自制力不够,还是电商平台太会读懂人心,从技术维度,抽丝剥茧一探究竟. 摘要:动辄几十上百万人同时在线的直播间,让所有人能同时公平的去抢购,并且还 ...
- 【Azure 机器人】微软Azure Bot 编辑器系列(2) : 机器人/用户提问回答模式,机器人从API获取响应并组织答案 (The Bot Framework Composer tutorials)
欢迎来到微软机器人编辑器使用教程,从这里开始,创建一个简单的机器人. 在该系列文章中,每一篇都将通过添加更多的功能来构建机器人.当完成教程中的全部内容后,你将成功的创建一个天气机器人(Weather ...
- TopN算法,流式数据获取前N条数据
背景:由于业务需求,用户想要统计每周,每月,几个月,一年之中的前N条数据. 根据已有的思路无非就是对全部的数据进行排序,然后取出前N条数据,可是这样的话按照目前最优的排序算法复杂度也在O(nlog(n ...