A family of Microsoft word processing software products for creating web, email, and print documents.
Thanks Andreas and macropod for your replies.
I’m very beginner in VBA, Ms Word especially and I can’t to run your codes. I must combine your codes with mine, or what?
I need to know how use your codes step-by-step like here:
http://www.vbaexpress.com/kb/getarticle.php?kb\_id=341
1.Open an Excel workbook
2.Select Tools/Macro/Visual Basic Editor
3.In the VBE window
4.Copy and paste the code …
[quote]Why 4? What about page 2 and 6? I can't see this pages in your list[/quote]
[how quotes in forum?]
That’s only example.
Once more. I have a very long document, e.g., 50 pages. What I need to get in results (results generate in a new MS Word document, or in the end of active/current MS Word document, or export results to MS Excel, because, then I must to sort them in Excel):
Results in columns:
1Column: Words (e.g. cat), 2C: Page numbers (in which page the word, e.g. “cat” appear in document) with a hypen (when the page numbers are consecutive) or with a commas (when the page numbers are not consecutive) (e.g. 1-2,9,12-13,21-23,50) 3C: Page numbers without a hypen, only with commas, (eg. 1,2,9,12,13,21,22,23,50) 4C: number of page numbers (Andreas, I explain, for e.g. in this case will be, let me count, 1,2,9,12,13,21,22,23,50 = 9, because the “cat” appear on ninth pages; you must to count the number of page numbers) 5C: Frequency of Occurrence (FQ) (e.g. “cat” appears 15 times in document, so we have 15)
Maybe once more, but shortly this time:
Results in columns:
I cat II 1-2,9,12-13,21-23,50 III 1,2,9,12,13,21,22,23,50 IV 9 V 15
And in the code I want to regulate: search for all words, or search for keywords, if it is possible, if not, maybe need two codes to do this.
I hope so it’s clearly.