-
當前位置:首頁 > 創(chuàng)意學院 > 營銷推廣 > 專題列表 > 正文
- 如何從EXCEL中提取相應數(shù)據(jù)批量生成WORD文檔
- excel數(shù)據(jù)表內容自動填寫在一個Word文檔里,怎么弄
- 跪求:能批量把Excel 中的每一行內容逐一轉換成word的一頁表格的軟件或方法?
- 如何將excel每次輸入的數(shù)據(jù),生成新的一份WORD文件(word文件是以表格形式反映)
Excel表格每行生產一個Word(excel每行生成word單個文檔)
大家好!今天讓創(chuàng)意嶺的小編來大家介紹下關于Excel表格每行生產一個Word的問題,以下是小編對此問題的歸納整理,讓我們一起來看看吧。
開始之前先推薦一個非常厲害的Ai人工智能工具,一鍵生成原創(chuàng)文章、方案、文案、工作計劃、工作報告、論文、代碼、作文、做題和對話答疑等等
只需要輸入關鍵詞,就能返回你想要的內容,有小程序、在線網頁版、PC客戶端和批量生成器
本文目錄:
如何從EXCEL中提取相應數(shù)據(jù)批量生成WORD文檔
準備好將生成文檔的數(shù)據(jù)(excel格式)。將制式的文檔的打開,按照文檔每一項的順序依次插入數(shù)據(jù)源(下面會用簡單的數(shù)據(jù)作為例子)。
首先點擊word工具欄中的引用,然后點擊郵件。
3.此時,工具欄中顯示是郵件合并,然后點擊打開數(shù)據(jù)源,查找你需要導入的數(shù)據(jù)表格,點擊打開即可。
4.光標落到任意項即可,不分先后順序,但最好按順序依次插入。文檔上的項必須和插入域中選中的項一致,然后點擊插入,然后點擊關閉,依次插完合并域,注:每項插完后必須點擊關閉,要不然就是重復插入呦,(注:操作正確的話,默認為數(shù)據(jù)庫域)如果一不小心,在插入合并域時不小心點到工具欄中的其他選項,不要著急,直接點引用-郵件可以繼續(xù)插入呢
5.全部合并域插完后,是這個樣子滴,提醒小伙伴們,一定要再三檢查完插入是否正確呦
6.檢查無誤后,點擊工具欄中的合并到新文檔
7.最后生成就是這個樣子啦
excel數(shù)據(jù)表內容自動填寫在一個Word文檔里,怎么弄
萬能的vba可以實現(xiàn)。參考如下: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 '車輛臺數(shù)
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 '發(fā)動機號
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 '驅動軸數(shù)
Dim kzZl As Double '空載質量
Dim dcZs As Integer '單車軸數(shù)
Dim wkcC As String '外廓尺寸
Dim zcZ As String '駐車軸
Dim cxlbGd As String '車廂欄板高度
Dim clDj As Integer '車輛等級
Dim yssjArr(1 To 4, 1 To 7) '原始數(shù)據(jù)
Dim dzsjArr(1 To 4, 1 To 6) '單軸數(shù)據(jù)
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 '發(fā)動機功率=核定功率
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)”。
單擊之后會出現(xiàn)如圖所示,這時選擇后方的“選擇(E)工作表”選項,選擇好之后單擊下方的“保存”按鈕。
保存之后就完成了。
如何將excel每次輸入的數(shù)據(jù),生成新的一份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相關問題的回答。希望能幫到你,如有更多相關問題,您也可以聯(lián)系我們的客服進行咨詢,客服也會為您講解更多精彩的知識和內容。
推薦閱讀:
如何用word制作標簽打印模板(excel打印不干膠標簽紙)
pdf有空白頁怎么刪除(excel轉pdf有空白頁怎么刪除)