- 如何从EXCEL中提取相应数据批量生成WORD文档
- excel数据表内容自动填写在一个Word文档里,怎么弄
- 跪求:能批量把Excel 中的每一行内容逐一转换成word的一页表格的软件或方法?
- 如何将excel每次输入的数据,生成新的一份WORD文件(word文件是以表格形式反映)
Excel表格每行生产一个Word(excel每行生成word单个文档)
大家好!今天让创意岭的小编来大家介绍下关于Excel表格每行生产一个Word的问题,以下是小编对此问题的归纳整理,让我们一起来看看吧。
开始之前先推荐一个非常厉害的Ai人工智能工具,一键生成原创文章、方案、文案、工作计划、工作报告、论文、代码、作文、做题和对话答疑等等
只需要输入关键词,就能返回你想要的内容,有小程序、在线网页版、PC客户端和批量生成器
本文目录:
如何从EXCEL中提取相应数据批量生成WORD文档
准备好将生成文档的数据(excel格式)。将制式的文档的打开,按照文档每一项的顺序依次插入数据源(下面会用简单的数据作为例子)。
首先点击word工具栏中的引用,然后点击邮件。
3.此时,工具栏中显示是邮件合并,然后点击打开数据源,查找你需要导入的数据表格,点击打开即可。
4.光标落到任意项即可,不分先后顺序,但最好按顺序依次插入。文档上的项必须和插入域中选中的项一致,然后点击插入,然后点击关闭,依次插完合并域,注:每项插完后必须点击关闭,要不然就是重复插入呦,(注:操作正确的话,默认为数据库域)如果一不小心,在插入合并域时不小心点到工具栏中的其他选项,不要着急,直接点引用-邮件可以继续插入呢
5.全部合并域插完后,是这个样子滴,提醒小伙伴们,一定要再三检查完插入是否正确呦
6.检查无误后,点击工具栏中的合并到新文档
7.最后生成就是这个样子啦
excel数据表内容自动填写在一个Word文档里,怎么弄
万能的vba可以实现。参考如下:Sub jyjlD() '检验记录单
Dim lsArr(1 To 1000, 1 To 2)
Dim myPath As String, myFile As String
Dim gsdkBj As Boolean '公式打开标记
Dim sBook As Workbook
Dim Wdoc, mYdocument
Dim myTable, myCell
Dim myName As String
Dim Ts As Integer '车辆台数
Dim wtR As String '委托人
Dim dlysZ As String '道路运输证
Dim ywlX As String
Dim jyrQ As Date
Dim jyjlbH As String
Dim hphM As String
Dim hpzL As String
Dim cllX As String '车辆类型
Dim ccRQ As Date '出厂日期
Dim zcdjRQ As Date
Dim VIN As String
Dim clxH As String
Dim ppxH As String '品牌型号
Dim fdjH As String '发动机号
Dim csYs As String
Dim xszlC As Double
Dim qdxS As String
Dim hdgL As Double '核定功率
Dim ltxH As String
Dim zzL As Double '总质量
Dim cGd As Integer '车高度
Dim qlJ As Integer '前轮距
Dim csxS As String
Dim qdZs As Integer '驱动轴数
Dim kzZl As Double '空载质量
Dim dcZs As Integer '单车轴数
Dim wkcC As String '外廓尺寸
Dim zcZ As String '驻车轴
Dim cxlbGd As String '车厢栏板高度
Dim clDj As Integer '车辆等级
Dim yssjArr(1 To 4, 1 To 7) '原始数据
Dim dzsjArr(1 To 4, 1 To 6) '单轴数据
Dim 水平称重 As Double, 整车制动率 As Double, 驻车制动率 As Double
Const bgMc = "综合性能检验记录单"
For Each sBook In Application.Workbooks
If sBook.Name = "计算公式.xlsx" Then
gsdkBj = True
Exit For
End If
Next sBook
If Not gsdkBj Then
Set sBook = Application.Workbooks.Open(ThisWorkbook.Path & "计算公式.xlsx")
End If
Ts = sBook.Sheets("车辆信息表").Cells(65536, 1).End(xlUp).Row - 1
For i = 1 To Ts
With sBook.Sheets("车辆信息表")
wtR = .Cells(i + 1, 2).Text
dlysZ = .Cells(i + 1, 3).Text
ywlX = .Cells(i + 1, 4).Text
jyrQ = .Cells(i + 1, 5).Value
jyjlbH = .Cells(i + 1, 6).Text
hphM = .Cells(i + 1, 7).Text
hpzL = .Cells(i + 1, 8).Text
cllX = .Cells(i + 1, 9).Text
ccRQ = .Cells(i + 1, 10).Value
zcdjRQ = .Cells(i + 1, 11).Value
VIN = .Cells(i + 1, 12).Text
clxH = .Cells(i + 1, 13).Text
ppxH = .Cells(i + 1, 14).Text
fdjH = .Cells(i + 1, 15).Text
csYs = .Cells(i + 1, 16).Text
xszlC = .Cells(i + 1, 17).Value
qdxS = .Cells(i + 1, 18).Text
hdgL = .Cells(i + 1, 19).Value '发动机功率=核定功率
ltxH = .Cells(i + 1, 20).Text
zzL = .Cells(i + 1, 21).Value
cGd = .Cells(i + 1, 22).Value
qlJ = .Cells(i + 1, 23).Value
csxS = .Cells(i + 1, 24).Text
qdZs = .Cells(i + 1, 25).Value
kzZl = .Cells(i + 1, 26).Value
dcZs = .Cells(i + 1, 27).Value
wkcC = .Cells(i + 1, 28).Text
zcZ = .Cells(i + 1, 29).Text
cxlbGd = .Cells(i + 1, 30).Text
clDj = IIf(Now - ccRQ < 365, 1, 2) '一年以内为1级
End With
FileCopy ThisWorkbook.Path & "" & bgMc & ".docx", ThisWorkbook.Path & "报告" & bgMc & "_" & wtR & ".docx"
Set Wdoc = CreateObject("word.application")
Wdoc.Visible = True
Set mYdocument = Wdoc.Documents.Open(ThisWorkbook.Path & "报告" & bgMc & "_" & wtR & ".docx")
'临时
'Set myTable = mYdocument.Tables(1)
'For j = 1 To myTable.Range.Cells.Count
' lsArr(j, 1) = j
' lsArr(j, 2) = myTable.Range.Cells(j).Range.Text
'Next j
'Sheets("sheet3").Activate
'Cells(1, 6).Resize(j - 1, 2) = lsArr
Set myTable = mYdocument.Tables(1)
myTable.Range.Cells(2).Range.Text = hphM
myTable.Range.Cells(4).Range.Text = hpzL
myTable.Range.Cells(9).Range.Text = Format(ccRQ, "yyyy-mm-dd")
myTable.Range.Cells(12).Range.Text = Format(zcdjRQ, "yyyy-mm-dd")
myTable.Range.Cells(14).Range.Text = VIN
myTable.Range.Cells(16).Range.Text = clxH
myTable.Range.Cells(18).Range.Text = fdjH
myTable.Range.Cells(20).Range.Text = csYs
myTable.Range.Cells(22).Range.Text = Format(xszlC, "0.0")
myTable.Range.Cells(24).Range.Text = qdxS
myTable.Range.Cells(30).Range.Text = Format(hdgL, "0.0")
myTable.Range.Cells(36).Range.Text = ltxH
myTable.Range.Cells(38).Range.Text = Format(zzL, "0")
myTable.Range.Cells(40).Range.Text = cGd
myTable.Range.Cells(42).Range.Text = qlJ
myTable.Range.Cells(52).Range.Text = Format(kzZl, "0")
myTable.Range.Cells(64).Range.Text = dcZs
myTable.Range.Cells(66).Range.Text = wkcC
myTable.Range.Cells(72).Range.Text = zcZ
myTable.Range.Cells(74).Range.Text = cxlbGd
Set myTable = mYdocument.Tables(3)
myTable.Range.Cells(10).Range.Text = Format(IIf(clDj = 1, hdgL * 0.82, hdgL * 0.75), "0.0") '达标功率
myTable.Range.Cells(11).Range.Text = Application.WorksheetFunction.RandBetween(500, 680) / 10 '核定车速
myTable.Range.Cells(12).Range.Text = IIf(cllX = "大型汽车", Application.WorksheetFunction.RandBetween(7000, 10000), Application.WorksheetFunction.RandBetween(4000, 7000)) '加载力
Select Case dcZs
Case 4
Set mySheet = sBook.Sheets("四轴")
mySheet.Calculate
With mySheet
水平称重 = .Cells(7, 3).Value
整车制动率 = .Cells(7, 7).Value
驻车制动率 = .Cells(7, 11).Value
For j = 1 To 4
yssjArr(j, 1) = .Cells(3 + j - 1, 3).Value
yssjArr(j, 2) = .Cells(3 + j - 1, 4).Value
yssjArr(j, 3) = .Cells(3 + j - 1, 5).Value
yssjArr(j, 4) = .Cells(3 + j - 1, 8).Value
yssjArr(j, 5) = .Cells(3 + j - 1, 9).Value
yssjArr(j, 6) = .Cells(3 + j - 1, 10).Value
yssjArr(j, 7) = .Cells(3 + j - 1, 11).Value
dzsjArr(j, 1) = Round(.Cells(11 + j - 1, 3).Value, 1)
dzsjArr(j, 2) = Round(.Cells(11 + j - 1, 4).Value, 1)
dzsjArr(j, 3) = .Cells(11 + j - 1, 5).Value
dzsjArr(j, 4) = .Cells(11 + j - 1, 6).Value
dzsjArr(j, 5) = .Cells(11 + j - 1, 12).Value
dzsjArr(j, 6) = .Cells(11 + j - 1, 13).Value
Next j
End With
'写入模板
myTable.Range.Cells(39).Range.Text = yssjArr(1, 1)
myTable.Range.Cells(40).Range.Text = yssjArr(1, 2)
myTable.Range.Cells(41).Range.Text = yssjArr(1, 3)
myTable.Range.Cells(44).Range.Text = yssjArr(1, 4)
myTable.Range.Cells(45).Range.Text = yssjArr(1, 5)
myTable.Range.Cells(46).Range.Text = IIf(yssjArr(1, 6) > 0, yssjArr(1, 6), "-")
myTable.Range.Cells(47).Range.Text = IIf(yssjArr(1, 7) > 0, yssjArr(1, 7), "-")
myTable.Range.Cells(50).Range.Text = yssjArr(2, 1)
myTable.Range.Cells(51).Range.Text = yssjArr(2, 2)
myTable.Range.Cells(52).Range.Text = yssjArr(2, 3)
myTable.Range.Cells(55).Range.Text = yssjArr(2, 4)
myTable.Range.Cells(56).Range.Text = yssjArr(2, 5)
myTable.Range.Cells(57).Range.Text = IIf(yssjArr(2, 6) > 0, yssjArr(2, 6), "-")
myTable.Range.Cells(58).Range.Text = IIf(yssjArr(2, 7) > 0, yssjArr(2, 7), "-")
myTable.Range.Cells(60).Range.Text = yssjArr(3, 1)
myTable.Range.Cells(61).Range.Text = yssjArr(3, 2)
myTable.Range.Cells(62).Range.Text = yssjArr(3, 3)
myTable.Range.Cells(65).Range.Text = yssjArr(3, 4)
myTable.Range.Cells(66).Range.Text = yssjArr(3, 5)
myTable.Range.Cells(67).Range.Text = IIf(yssjArr(3, 6) > 0, yssjArr(3, 6), "-")
myTable.Range.Cells(68).Range.Text = IIf(yssjArr(3, 7) > 0, yssjArr(3, 7), "-")
myTable.Range.Cells(70).Range.Text = yssjArr(4, 1)
myTable.Range.Cells(71).Range.Text = yssjArr(4, 2)
myTable.Range.Cells(72).Range.Text = yssjArr(4, 3)
myTable.Range.Cells(75).Range.Text = yssjArr(4, 4)
myTable.Range.Cells(76).Range.Text = yssjArr(4, 5)
myTable.Range.Cells(77).Range.Text = IIf(yssjArr(4, 6) > 0, yssjArr(3, 6), "-")
myTable.Range.Cells(78).Range.Text = IIf(yssjArr(4, 7) > 0, yssjArr(3, 7), "-")
myTable.Range.Cells(101).Range.Text = "水平称重 " & Format(水平称重, "0") & " daN"
myTable.Range.Cells(102).Range.Text = "整车制动率 " & Format(整车制动率, "0.0%")
myTable.Range.Cells(103).Range.Text = "驻车制动率" & Format(驻车制动率, "0.0%")
myTable.Range.Cells(161).Range.Text = dzsjArr(1, 1)
myTable.Range.Cells(162).Range.Text = dzsjArr(1, 2)
myTable.Range.Cells(163).Range.Text = dzsjArr(1, 3)
myTable.Range.Cells(164).Range.Text = dzsjArr(1, 4)
myTable.Range.Cells(165).Range.Text = Format(dzsjArr(1, 5), "0.0")
myTable.Range.Cells(166).Range.Text = Format(dzsjArr(1, 6), "0.0")
myTable.Range.Cells(169).Range.Text = dzsjArr(2, 1)
myTable.Range.Cells(170).Range.Text = dzsjArr(2, 2)
myTable.Range.Cells(171).Range.Text = dzsjArr(2, 3)
myTable.Range.Cells(172).Range.Text = dzsjArr(2, 4)
myTable.Range.Cells(173).Range.Text = Format(dzsjArr(2, 5), "0.0")
myTable.Range.Cells(174).Range.Text = Format(dzsjArr(2, 6), "0.0")
myTable.Range.Cells(177).Range.Text = dzsjArr(3, 1)
myTable.Range.Cells(178).Range.Text = dzsjArr(3, 2)
myTable.Range.Cells(179).Range.Text = dzsjArr(3, 3)
myTable.Range.Cells(180).Range.Text = dzsjArr(3, 4)
myTable.Range.Cells(181).Range.Text = Format(dzsjArr(3, 5), "0.0")
myTable.Range.Cells(182).Range.Text = Format(dzsjArr(3, 6), "0.0")
myTable.Range.Cells(185).Range.Text = dzsjArr(4, 1)
myTable.Range.Cells(186).Range.Text = dzsjArr(4, 2)
myTable.Range.Cells(187).Range.Text = dzsjArr(4, 3)
myTable.Range.Cells(188).Range.Text = dzsjArr(4, 4)
myTable.Range.Cells(189).Range.Text = Format(dzsjArr(4, 5), "0.0")
myTable.Range.Cells(190).Range.Text = Format(dzsjArr(4, 6), "0.0")
Case 3
Set mySheet = sBook.Sheets("三轴")
mySheet.Calculate
With mySheet
水平称重 = .Cells(6, 3).Value
整车制动率 = .Cells(6, 7).Value
驻车制动率 = .Cells(6, 11).Value
For j = 1 To 3
yssjArr(j, 1) = .Cells(3 + j - 1, 3).Value
yssjArr(j, 2) = .Cells(3 + j - 1, 4).Value
yssjArr(j, 3) = .Cells(3 + j - 1, 5).Value
yssjArr(j, 4) = .Cells(3 + j - 1, 8).Value
yssjArr(j, 5) = .Cells(3 + j - 1, 9).Value
yssjArr(j, 6) = .Cells(3 + j - 1, 10).Value
yssjArr(j, 7) = .Cells(3 + j - 1, 11).Value
dzsjArr(j, 1) = Round(.Cells(10 + j - 1, 3).Value, 1)
dzsjArr(j, 2) = Round(.Cells(10 + j - 1, 4).Value, 1)
dzsjArr(j, 3) = .Cells(10 + j - 1, 5).Value
dzsjArr(j, 4) = .Cells(10 + j - 1, 6).Value
dzsjArr(j, 5) = .Cells(10 + j - 1, 12).Value
dzsjArr(j, 6) = .Cells(10 + j - 1, 13).Value
Next j
End With
'写入模板
myTable.Range.Cells(39).Range.Text = yssjArr(1, 1)
myTable.Range.Cells(40).Range.Text = yssjArr(1, 2)
myTable.Range.Cells(41).Range.Text = yssjArr(1, 3)
myTable.Range.Cells(44).Range.Text = yssjArr(1, 4)
myTable.Range.Cells(45).Range.Text = yssjArr(1, 5)
myTable.Range.Cells(46).Range.Text = IIf(yssjArr(1, 6) > 0, yssjArr(1, 6), "-")
myTable.Range.Cells(47).Range.Text = IIf(yssjArr(1, 7) > 0, yssjArr(1, 7), "-")
myTable.Range.Cells(50).Range.Text = yssjArr(2, 1)
myTable.Range.Cells(51).Range.Text = yssjArr(2, 2)
myTable.Range.Cells(52).Range.Text = yssjArr(2, 3)
myTable.Range.Cells(55).Range.Text = yssjArr(2, 4)
myTable.Range.Cells(56).Range.Text = yssjArr(2, 5)
myTable.Range.Cells(57).Range.Text = IIf(yssjArr(2, 6) > 0, yssjArr(2, 6), "-")
myTable.Range.Cells(58).Range.Text = IIf(yssjArr(2, 7) > 0, yssjArr(2, 7), "-")
myTable.Range.Cells(60).Range.Text = yssjArr(3, 1)
myTable.Range.Cells(61).Range.Text = yssjArr(3, 2)
myTable.Range.Cells(62).Range.Text = yssjArr(3, 3)
myTable.Range.Cells(65).Range.Text = yssjArr(3, 4)
myTable.Range.Cells(66).Range.Text = yssjArr(3, 5)
myTable.Range.Cells(67).Range.Text = IIf(yssjArr(3, 6) > 0, yssjArr(3, 6), "-")
myTable.Range.Cells(68).Range.Text = IIf(yssjArr(3, 7) > 0, yssjArr(3, 7), "-")
myTable.Range.Cells(70).Range.Text = "-"
myTable.Range.Cells(71).Range.Text = "-"
myTable.Range.Cells(72).Range.Text = "-"
myTable.Range.Cells(75).Range.Text = "-"
myTable.Range.Cells(76).Range.Text = "-"
myTable.Range.Cells(77).Range.Text = "-"
myTable.Range.Cells(78).Range.Text = "-"
myTable.Range.Cells(101).Range.Text = "水平称重 " & Format(水平称重, "0") & " daN"
myTable.Range.Cells(102).Range.Text = "整车制动率 " & Format(整车制动率, "0.0%")
myTable.Range.Cells(103).Range.Text = "驻车制动率" & Format(驻车制动率, "0.0%")
myTable.Range.Cells(161).Range.Text = dzsjArr(1, 1)
myTable.Range.Cells(162).Range.Text = dzsjArr(1, 2)
myTable.Range.Cells(163).Range.Text = dzsjArr(1, 3)
myTable.Range.Cells(164).Range.Text = dzsjArr(1, 4)
myTable.Range.Cells(165).Range.Text = Format(dzsjArr(1, 5), "0.0")
myTable.Range.Cells(166).Range.Text = Format(dzsjArr(1, 6), "0.0")
myTable.Range.Cells(169).Range.Text = dzsjArr(2, 1)
myTable.Range.Cells(170).Range.Text = dzsjArr(2, 2)
myTable.Range.Cells(171).Range.Text = dzsjArr(2, 3)
myTable.Range.Cells(172).Range.Text = dzsjArr(2, 4)
myTable.Range.Cells(173).Range.Text = Format(dzsjArr(2, 5), "0.0")
myTable.Range.Cells(174).Range.Text = Format(dzsjArr(2, 6), "0.0")
myTable.Range.Cells(177).Range.Text = dzsjArr(3, 1)
myTable.Range.Cells(178).Range.Text = dzsjArr(3, 2)
myTable.Range.Cells(179).Range.Text = dzsjArr(3, 3)
myTable.Range.Cells(180).Range.Text = dzsjArr(3, 4)
myTable.Range.Cells(181).Range.Text = Format(dzsjArr(3, 5), "0.0")
myTable.Range.Cells(182).Range.Text = Format(dzsjArr(3, 6), "0.0")
myTable.Range.Cells(185).Range.Text = "-"
myTable.Range.Cells(186).Range.Text = "-"
myTable.Range.Cells(187).Range.Text = "-"
myTable.Range.Cells(188).Range.Text = "-"
myTable.Range.Cells(189).Range.Text = "-"
myTable.Range.Cells(190).Range.Text = "-"
Case 2
Set mySheet = sBook.Sheets("二轴")
mySheet.Calculate
With mySheet
水平称重 = .Cells(5, 3).Value
整车制动率 = .Cells(5, 7).Value
驻车制动率 = .Cells(5, 11).Value
For j = 1 To 2
yssjArr(j, 1) = .Cells(3 + j - 1, 3).Value
yssjArr(j, 2) = .Cells(3 + j - 1, 4).Value
yssjArr(j, 3) = .Cells(3 + j - 1, 5).Value
yssjArr(j, 4) = .Cells(3 + j - 1, 8).Value
yssjArr(j, 5) = .Cells(3 + j - 1, 9).Value
yssjArr(j, 6) = .Cells(3 + j - 1, 10).Value
yssjArr(j, 7) = .Cells(3 + j - 1, 11).Value
dzsjArr(j, 1) = Round(.Cells(9 + j - 1, 3).Value, 1)
dzsjArr(j, 2) = Round(.Cells(9 + j - 1, 4).Value, 1)
dzsjArr(j, 3) = .Cells(9 + j - 1, 5).Value
dzsjArr(j, 4) = .Cells(9 + j - 1, 6).Value
dzsjArr(j, 5) = .Cells(9 + j - 1, 12).Value
dzsjArr(j, 6) = .Cells(9 + j - 1, 13).Value
Next j
End With
'写入模板
myTable.Range.Cells(39).Range.Text = yssjArr(1, 1)
myTable.Range.Cells(40).Range.Text = yssjArr(1, 2)
myTable.Range.Cells(41).Range.Text = yssjArr(1, 3)
myTable.Range.Cells(44).Range.Text = yssjArr(1, 4)
myTable.Range.Cells(45).Range.Text = yssjArr(1, 5)
myTable.Range.Cells(46).Range.Text = IIf(yssjArr(1, 6) > 0, yssjArr(1, 6), "-")
myTable.Range.Cells(47).Range.Text = IIf(yssjArr(1, 7) > 0, yssjArr(1, 7), "-")
myTable.Range.Cells(50).Range.Text = yssjArr(2, 1)
myTable.Range.Cells(51).Range.Text = yssjArr(2, 2)
myTable.Range.Cells(52).Range.Text = yssjArr(2, 3)
myTable.Range.Cells(55).Range.Text = yssjArr(2, 4)
myTable.Range.Cells(56).Range.Text = yssjArr(2, 5)
myTable.Range.Cells(57).Range.Text = IIf(yssjArr(2, 6) > 0, yssjArr(2, 6), "-")
myTable.Range.Cells(58).Range.Text = IIf(yssjArr(2, 7) > 0, yssjArr(2, 7), "-")
myTable.Range.Cells(60).Range.Text = "-"
myTable.Range.Cells(61).Range.Text = "-"
myTable.Range.Cells(62).Range.Text = "-"
myTable.Range.Cells(65).Range.Text = "-"
myTable.Range.Cells(66).Range.Text = "-"
myTable.Range.Cells(67).Range.Text = "-"
myTable.Range.Cells(68).Range.Text = "-"
myTable.Range.Cells(70).Range.Text = "-"
myTable.Range.Cells(71).Range.Text = "-"
myTable.Range.Cells(72).Range.Text = "-"
myTable.Range.Cells(75).Range.Text = "-"
myTable.Range.Cells(76).Range.Text = "-"
myTable.Range.Cells(77).Range.Text = "-"
myTable.Range.Cells(78).Range.Text = "-"
myTable.Range.Cells(101).Range.Text = "水平称重 " & Format(水平称重, "0") & " daN"
myTable.Range.Cells(102).Range.Text = "整车制动率 " & Format(整车制动率, "0.0%")
myTable.Range.Cells(103).Range.Text = "驻车制动率" & Format(驻车制动率, "0.0%")
myTable.Range.Cells(161).Range.Text = dzsjArr(1, 1)
myTable.Range.Cells(162).Range.Text = dzsjArr(1, 2)
myTable.Range.Cells(163).Range.Text = dzsjArr(1, 3)
myTable.Range.Cells(164).Range.Text = dzsjArr(1, 4)
myTable.Range.Cells(165).Range.Text = Format(dzsjArr(1, 5), "0.0")
myTable.Range.Cells(166).Range.Text = Format(dzsjArr(1, 6), "0.0")
myTable.Range.Cells(169).Range.Text = dzsjArr(2, 1)
myTable.Range.Cells(170).Range.Text = dzsjArr(2, 2)
myTable.Range.Cells(171).Range.Text = dzsjArr(2, 3)
myTable.Range.Cells(172).Range.Text = dzsjArr(2, 4)
myTable.Range.Cells(173).Range.Text = Format(dzsjArr(2, 5), "0.0")
myTable.Range.Cells(174).Range.Text = Format(dzsjArr(2, 6), "0.0")
myTable.Range.Cells(177).Range.Text = "-"
myTable.Range.Cells(178).Range.Text = "-"
myTable.Range.Cells(179).Range.Text = "-"
myTable.Range.Cells(180).Range.Text = "-"
myTable.Range.Cells(181).Range.Text = "-"
myTable.Range.Cells(182).Range.Text = "-"
myTable.Range.Cells(185).Range.Text = "-"
myTable.Range.Cells(186).Range.Text = "-"
myTable.Range.Cells(187).Range.Text = "-"
myTable.Range.Cells(188).Range.Text = "-"
myTable.Range.Cells(189).Range.Text = "-"
myTable.Range.Cells(190).Range.Text = "-"
End Select
mYdocument.Save
mYdocument.Close
Wdoc.Quit
Next i
End Sub
跪求:能批量把Excel 中的每一行内容逐一转换成word的一页表格的软件或方法?
方法/步骤:
首先打开excel文档.
看到在表格的左上角有一个“microsoft office”图标,单击该图标会下拉选项。
在下拉的选项里我们将鼠标移到“另存为”处又会下拉如图所示,这时我们单击“其他格式”按钮。
单击之后会弹出如图对话框,这时单击“保存类型”后面的小倒三角形,单击之后会下拉如图所示选项,这时我们在下拉的选项里单击“单个文件网页(*mht:*mhtml)”。
单击之后会出现如图所示,这时选择后方的“选择(E)工作表”选项,选择好之后单击下方的“保存”按钮。
保存之后就完成了。
如何将excel每次输入的数据,生成新的一份WORD文件(word文件是以表格形式反映)
1、在Word里面打开那个需要分割的文档(假设它的文件名叫做“原始文档.doc”);
2、键入ALT+F11打开VBA编辑器,选择菜单“插入-模块”;
3、粘贴下面的代码:
Option Explicit
Sub SplitPagesAsDocuments()
Dim oSrcDoc As Document, oNewDoc As Document
Dim strSrcName As String, strNewName As String
Dim oRange As Range
Dim nIndex As Integer
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set oSrcDoc = ActiveDocument
Set oRange = oSrcDoc.Content
oRange.Collapse wdCollapseStart
oRange.Select
For nIndex = 1 ToActiveDocument.Content.Information(wdNumberOfPagesInDocument)
oSrcDoc.Bookmarks("page").Range.Copy
oSrcDoc.Windows(1).Activate
Application.Browser.Target = wdBrowsePage
Application.Browser.Next
strSrcName = oSrcDoc.FullName
strNewName = fso.BuildPath(fso.GetParentFolderName(strSrcName), _
fso.GetBaseName(strSrcName) & "_" & nIndex &"." & fso.GetExtensionName(strSrcName))
Set oNewDoc = Documents.Add
Selection.Paste
oNewDoc.SaveAs strNewName
oNewDoc.Close False
Next
Set oNewDoc = Nothing
Set oRange = Nothing
Set oSrcDoc = Nothing
Set fso = Nothing
MsgBox "结束!"
End Sub
4、键入F5运行,看到“完成!”结束。
以上就是关于Excel表格每行生产一个Word相关问题的回答。希望能帮到你,如有更多相关问题,您也可以联系我们的客服进行咨询,客服也会为您讲解更多精彩的知识和内容。
推荐阅读:
如何用word制作标签打印模板(excel打印不干胶标签纸)
pdf有空白页怎么删除(excel转pdf有空白页怎么删除)