ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

¦p¦ó§Q¥Îexcel ±±¨î word©O?

¦p¦ó§Q¥Îexcel ±±¨î word©O?

½Ð°Ý¦U¦ì¤j¤j¡A§Q¥Îexcel²£¥Í¤¶­±«á¡A¦p¦ó±±¨îword©O¡H

¬O³o¼Ëªº¡A¤pªº¦b¤u§@¤W»Ý¨Ï¥Î½d¥»§ó§ï¤º®e¡A²£¥Í·sªºÀɮסA»Ý¨Ï¥Îexcel¤Îword¡ã

¯à§_¦bexcel³]­p¥X¤¶­±«á¡A©I¥sword¡A¨Ã±±¨î§ó§ïword¤º®e©O¡H

°ÝÃD¤Ó¼Ò½k¡I
Word§e²{·¥­PªºÀRºA¤§¬ü¡AExcel®i²{·¥­Pªº°ÊºA¤§¬ü¡C

TOP

Dim Wordapp As Word.Application
    Set Wordapp = New Word.Application      '·s«ØWordª«¥ó
    Wordapp.Visible = True                    '¥i¨£

    Dim WordD As Word.Document      '©w¸qwordÃþ
    Set WordD = Wordapp.Documents.Add       '·s«Ø¤å¥ó

    Wordapp.Selection.WholeStory  '¥þ¿ï
    Wordapp.Selection.Font.Name = "¦rÅé¦W
    Wordapp.Selection.Font.Size = 16   '¦r¤Ø¤o

TOP

¥Lªº·N«ä¬O¤£¬O§âEXCEL³]­p¦nªºª©­± ¥X¦¨WORD¤º®e?
¥H«á¥u­n§ïEXCEL ¡AWORD¤º®e¦Û°Ê§ïÅÜ?

TOP

¦X¨Ö¦C¦L¥\¯à

TOP

¦]¬°Åv­­¤£¨¬¤£¯à¶K³sµ²¡A½Ð¦Û¦æ½Æ»s
youtu.be/Stbqrk7PlGU

§Æ±æ¹ï§A¦³À°§U­ò¡I

TOP

Sub µo¤å()

Dim myStr As String
Dim myran As Range

On Error Resume Next
Set myran = Application.InputBox(prompt:="°é¿ï½d³ò", Type:=8)

myrow = myran.Row
mycol = myran.Column
mynum = myran.Rows.Count

'myfn = Cells(myrow, mycol - 1).Value

'For Each mye In myran

'If myStr = "" Then
'myStr = mye.Value
'Else: myStr = myStr & "¡B" & mye.Value
'End If
'Next
For i = 1 To mynum
mywd1 = Cells(myrow + i - 1, mycol).Value
mywd2 = Cells(myrow + i - 1, mycol + 1).Value
mywd3 = Cells(myrow + i - 1, mycol + 2).Value
mywd4 = Cells(myrow + i - 1, mycol + 4).Value
mywd5 = Cells(myrow + i - 1, mycol + 5).Value



Dim myWord As New Word.Application

myWord.Visible = True

Set mydoc = myWord.Documents.Open("desktop\1.¤½¤å\¤½¤å.DOC")

With mydoc.Content.Find
.Text = "MYWORD1"
.Replacement.Text = mywd1
Forward = True
.Wrap = wdFindContinue
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.Execute Replace:=wdReplaceAll
End With

With mydoc.Content.Find
.Text = "MYWORD2"
.Replacement.Text = mywd2
Forward = True
.Wrap = wdFindContinue
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.Execute Replace:=wdReplaceAll
End With

With mydoc.Content.Find
.Text = "MYWORD3"
.Replacement.Text = mywd3
Forward = True
.Wrap = wdFindContinue
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.Execute Replace:=wdReplaceAll
End With

With mydoc.Content.Find
.Text = "MYWORD4"
.Replacement.Text = mywd4
Forward = True
.Wrap = wdFindContinue
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.Execute Replace:=wdReplaceAll
End With

With mydoc.Content.Find
.Text = "MYWORD5"
.Replacement.Text = mywd5
Forward = True
.Wrap = wdFindContinue
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.Execute Replace:=wdReplaceAll
End With




mydoc.SaveAs Filename:="desktop\1.¤½¤å\¤½¤å" & mywd1 & mywd3
Next i
End Sub

TOP

        ÀR«ä¦Û¦b : ­ì½Ì§O¤H´N¬Oµ½«Ý¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD