已经设置好了打印区域
时间:2023-02-13 11:52:17
Excel设置打印一次单元格内容变一次的步骤:
sheet1中,已经设置好了打印区域。要求每打印一次,单元格B2中的日期就增加一天。
Alt+F11,打开VBE,双击sheet1工作表,以确认后续的代码是在sheet1中执行。
步骤阅读
复制如下代码到右侧的空白区域,然后按F5执行代码即可实现每打印一张,B2的日期增加一天。
Sub m()
For i = 1 To 100
ActiveSheet.PrintOut copies:=1
Cells(2, 2) = Cells(2, 2) + i
Next
End Sub
代码详解:
1.Sub m()——这是宏名,无需理会;
2.For i = 1 To 100——这是控制打印次数,后面的100就是打印的页数,可以通过更改这个数值,来控制打印多少页;
3.ActiveSheet.PrintOut copies:=1——这是打印当前页的代码,无需理会;
4.Cells(2, 2) = Cells(2, 2) + i——这里的Cells(2,2)就是单元格B2,其中第一个2是行数,第二个2是列数,更改这两个数值,就可以控制让哪个单元格的数值变动;
5.Next——继续循环,无需理会;
6.End Sub——结束宏,无需理会。
标签:代码,单元格,打印,这是,Excel教程
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
以上就是excel2010自动统计包含常量的单元格数量方法介绍
2022-09-26 21:12:28
电脑安装Win7系统后Word文档字体变化原因及解决方法
2022-05-05 06:40:51
PowerPoint for Mac 中的键盘快捷方式汇总
2023-03-15 02:14:45
![](https://img.aspxhome.com/file/2023/4/a213674_0s.png)
Word2013怎么取消自动编号功能?
2023-12-06 15:14:56
![](https://img.aspxhome.com/file/2023/9/19989_0s.jpg)
如何让AirPods同时连接两台手机?
2022-08-01 20:50:54
![](https://img.aspxhome.com/file/2023/0/a199920_0s.jpg)
Win7电脑自动调节屏幕亮度怎么关闭?Win7旗舰版自
2022-07-16 07:41:50
![](https://img.aspxhome.com/file/2023/4/a304690_0s.jpg)
咪咕视频怎么进行投屏?咪咕视频投屏方法
2022-03-05 12:26:39
![](https://img.aspxhome.com/file/2023/8/a332968_0s.jpg)
Excel2003中将同一列单元格中的内容进行分列
2022-06-27 01:46:32
![](https://img.aspxhome.com/file/2023/5/38975_0s.jpg)
win10访问账户信息应用权限设置教程
2023-11-23 22:44:00
![](https://img.aspxhome.com/file/2023/3/a296798_0s.gif)
Win10怎么开启开发人员模式?
2023-01-13 06:22:10
![](https://img.aspxhome.com/file/2023/26/a224027_0s.png)
wps表格给数据分列的教程是什么
2022-10-31 12:07:38
tmp文件是什么?tmp文件要怎么打开?
2022-06-07 01:28:05
![](https://img.aspxhome.com/file/2023/30/a265964_0s.png)
ios14多少g-ios14更新需要多少g详细介绍
2023-12-01 09:25:37
![](https://img.aspxhome.com/file/2023/3/a292530_0s.jpg)
wps如何将多行合并成一行
2022-03-05 04:30:57
![](https://img.aspxhome.com/file/2023/3/a184833_0s.png)
Excel 表格技巧—如何将多页表格打印到一页?
2023-06-07 01:16:09
WPS excel一秒创建N个命名工作簿
2022-12-18 04:03:11
![](https://img.aspxhome.com/file/2023/3/a187473_0s.jpg)
应用宝如何远程控制手机?应用宝远程控制手机的方法
2023-06-05 05:26:58
![](https://img.aspxhome.com/file/2023/8/a334342_0s.jpg)
Win10怎么给Windows Defender添加排除项?
2023-06-05 14:22:28
![](https://img.aspxhome.com/file/2023/26/a220865_0s.jpg)
升级 iOS 13 后视频缩略图变模糊怎么解决?
2022-08-18 02:21:50
![](https://img.aspxhome.com/file/2023/4/a196914_0s.jpg)
如何高效禁用windows8屏幕触摸键盘(通过停用服务实现)
2022-02-06 10:48:11