Chirurgia cranio-cerebrală minim invazivă
Tehnicile minim invazive impun utilizarea unei tehnologii ultramoderne. Endoscoapele operatorii de diverse tipuri, microscopul operator dedicat, neuronavigația, neuroelectrofiziologia, tehnicile avansate de anestezie, chirurgia cu pacientul treaz reprezintă armamentarium fără de care neurochirurgia prin "gaura cheii" nu ar fi posibilă. Folosind tehnicile de mai sus, tratăm un spectru larg de patologii cranio-cerebrale. www.neurohope.ro |
Script ( macro ) copiere automata data din excel in word
Last Updated: Jul 04 2016 11:22, Started by
Littleboy
, Jun 28 2016 16:50
·
0
#1
Posted 28 June 2016 - 16:50
Salutare,
Ma poate ajuta cineva cu un script care sa realizeze urmatoarea chestie? Am un draft word cu un text si un excel cu 100 de randuri, fiecare rand avand cate un numar ( CNP mai exact ). In word exista o casuta unde trebuie sa introduc CNP-ul ( respectiv sa fac 100 de word-uri pt. fiecare CNP in parte ). Exista cineva care ma poate ajuta cu un script/macro care sa imi completeze automat CNP-urile in word? Multumesc pt. ajutor |
#2
Posted 28 June 2016 - 17:24
Poti sa legi word cu excel (parca corespondenta incrucisata ii zice) si se vor crea atatea pagini word cate linii ai in excel. Toate paginile word vor fi dupa sablonul tau, diferind numai cnp-ul.
|
#3
Posted 28 June 2016 - 19:12
Ceea ce vrei tu exista deja in Word.
Intri in meniul Mailings la Start Mail Merge si apoi Step by Step, la pasul 3 alegi fisierul excel si mai departe te dercurci tu. Edited by Kroghy, 28 June 2016 - 19:15. |
#4
Posted 28 June 2016 - 20:02
Mail merge sau Imbinare corespondenta. Asta e butonul ce trebuie sa il folosesti. Face exact ce vrei.
|
#5
Posted 29 June 2016 - 11:35
Multumesc mult pentru ajutor, am reusit sa introduc CNP-urile din excel in word, insa m-am lovit de o mica problema.
Dupa ce am folosit functia "mail merge", mi-a iesit un singur word care contine 100 de pagini ( cate o pagina per CNP ). Exista vreo comanda din word cu care sa fac split? ( sa imi iasa 100 de fisiere word? ) sau e nevoie sa folosesc vreun programel care sa faca asta? |
#6
Posted 29 June 2016 - 12:07
Am rezolvat intre timp si problema asta. Multumesc mult pe ajutor.
|
#8
Posted 04 July 2016 - 11:22
Nu, am gasit un link pentru slit automat.
Codul este : Sub SplitIntoPages() Dim docMultiple As Document Dim docSingle As Document Dim rngPage As Range Dim iCurrentPage As Integer Dim iPageCount As Integer Dim strNewFileName As String Application.ScreenUpdating = False 'Makes the code run faster and reduces screen _ flicker a bit. Set docMultiple = ActiveDocument 'Work on the active document _ (the one currently containing the Selection) Set rngPage = docMultiple.Range 'instantiate the range object iCurrentPage = 1 'get the document's page count iPageCount = docMultiple.Content.ComputeStatistics(wdStatisticPages) Do Until iCurrentPage > iPageCount If iCurrentPage = iPageCount Then rngPage.End = Activedocument.Range.End 'last page (there won't be a next page) Else 'Find the beginning of the next page 'Must use the Selection object. The Range.Goto method will not work on a page Selection.GoTo wdGoToPage, wdGoToAbsolute, iCurrentPage + 1 'Set the end of the range to the point between the pages rngPage.End = Selection.Start End If rngPage.Copy 'copy the page into the Windows clipboard Set docSingle = Documents.Add 'create a new document docSingle.Range.Paste 'paste the clipboard contents to the new document 'remove any manual page break to prevent a second blank docSingle.Range.Find.Execute Findtext:="^m", ReplaceWith:="" 'build a new sequentially-numbered file name based on the original multi-paged file name and path strNewFileName = Replace(docMultiple.FullName, ".doc", "_" & Right$("000" & iCurrentPage, 4) & ".doc") docSingle.SaveAs strNewFileName 'save the new single-paged document iCurrentPage = iCurrentPage + 1 'move to the next page docSingle.Close 'close the new document rngPage.Collapse wdCollapseEnd 'go to the next page Loop 'go to the top of the do loop Application.ScreenUpdating = True 'restore the screen updating 'Destroy the objects. Set docMultiple = Nothing Set docSingle = Nothing Set rngPage = Nothing End Sub |
Anunturi
▶ 0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users