ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 Excel Home精品图文教程库
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
300集Office 2010微视频教程 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
查看: 2823|回复: 9

[求助] 【求助】宏,给每句话前面加上序号

[复制链接]

TA的精华主题

TA的得分主题

发表于 2013-10-17 09:02 | 显示全部楼层 |阅读模式
非常感谢高手帮我这个小忙,宏代码的具体要求如下:
一篇英语文章,给每一段的每句话依次编号1、2、3、……,详见附件第一段格式。
最后再次表示感谢。{:soso_e100:}

[求助]宏.zip

7.22 KB, 下载次数: 17

TA的精华主题

TA的得分主题

 楼主| 发表于 2013-10-17 09:10 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
第一次发帖,粗心了,第一段格式如下:
1、 Hunting for a job late last year, lawyer Gant Redmon stumbled across CareerBuilder, a job database on the Internet. 2 、He searched it with no success but was attracted by the site’s “personal search agent”.3、  It’s an interactive feature that lets visitors key in job criteria such as location, title, and salary, then E-mails them when a matching position is posted in the database. 4 、Redmon chose the keywords legal, intellectual property, and Washington, D.C. 5、 Three weeks later, he got his first notification of an opening.6、  “I struck gold,” says Redmon, who E-mailed his resume to the employer and won a position as in-house counsel for a company.

TA的精华主题

TA的得分主题

发表于 2013-10-17 09:39 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2013-10-17 11:45 | 显示全部楼层
文件上传,是不是要这种效果?
不用宏可以做到,页面布局下添加行号就行。

[求助]宏.zip

7.23 KB, 下载次数: 16

TA的精华主题

TA的得分主题

 楼主| 发表于 2013-10-17 12:00 | 显示全部楼层
excelhometiger 发表于 2013-10-17 11:45
文件上传,是不是要这种效果?
不用宏可以做到,页面布局下添加行号就行。

我粗心了,附件的第一段其实是这样的:
1、Hunting for a job late last year, lawyer Gant Redmon stumbled across CareerBuilder, a job database on the Internet. 2、He searched it with no success but was attracted by the site’s “personal search agent”.3、 It’s an interactive feature that lets visitors key in job criteria such as location, title, and salary, then E-mails them when a matching position is posted in the database.4、 Redmon chose the keywords legal, intellectual property, and Washington, D.C. 5、Three weeks later, he got his first notification of an opening. 6、“I struck gold,” says Redmon, who E-mailed his resume to the employer and won a position as in-house counsel for a company.
不是你那种格式,不过还是很感谢哥们花时间帮我,谢谢拉。

TA的精华主题

TA的得分主题

发表于 2013-10-17 13:38 | 显示全部楼层
Sub sdf()
Dim pa As Paragraph, se As Range
    For Each pa In ActiveDocument.Paragraphs
        i = 1
        For Each se In pa.Range.Sentences
            se.InsertBefore i & "、"
            i = i + 1
        Next
    Next
End Sub

评分

1

查看全部评分

TA的精华主题

TA的得分主题

 楼主| 发表于 2013-10-17 19:34 | 显示全部楼层
zhanglei1371 发表于 2013-10-17 13:38
Sub sdf()
Dim pa As Paragraph, se As Range
    For Each pa In ActiveDocument.Paragraphs

代码很好用,谢谢啦!

TA的精华主题

TA的得分主题

发表于 2019-8-18 16:36 | 显示全部楼层
zhanglei1371 发表于 2013-10-17 13:38
Sub sdf()
Dim pa As Paragraph, se As Range
    For Each pa In ActiveDocument.Paragraphs

我想每一段都按照递增标号分句可以吗?谢谢老哥按照这个格式:1.1xxxxx
1.2xxxxxx.1.3xxxxxx.1.4xxxxxx.1.5xxxx
1.6xxxxx

TA的精华主题

TA的得分主题

发表于 2019-8-18 16:45 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
zhanglei1371 发表于 2013-10-17 13:38
Sub sdf()
Dim pa As Paragraph, se As Range
    For Each pa In ActiveDocument.Paragraphs

忽视段落的话

TA的精华主题

TA的得分主题

发表于 2019-8-18 21:39 | 显示全部楼层
我只会查找替换
1替换点后加回车
2自动编号
3把回车替换为空
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-4-18 10:11 , Processed in 0.059405 second(s), 13 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表