Closed Thread
Results 1 to 5 of 5

Word2007 Please help a newbie get started!

  1. #1
    llyamah
    Guest

    Word2007 Please help a newbie get started!

    Hello All

    I have a report (sample attached) that I need some help with. I just don't know where to begin and I am a complete newbie to VBA - but keen to learn! If anyone can help me with this (either by helping with the code or telling me what I need to be learning to do this) then I would be so grateful.

    Basically, I need to be able to split this report into 'country specific' reports, so ideally I would be presented with a dropdown (or, less ideally, an input box) and I can select a country. The program will then scan the document for all paragraphs that relate to that country and spit it out into a new document. The new document needs to contain the red headings but it obviously will not need to contain the country name headings. If one of the countries doesn't have any information for one of the red headings, it could either leave that red heading out or say 'no data to report'.

    Does this make sense? Any pointers would be much appreciated! Thanks for looking!
    Attached Files Attached Files

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Word2007 Please help a newbie get started!

    Hi llyamah,

    Your document really isn't conducive to the kind of dissection you describe, for a number of reasons, including:
    • Everthing is in the same basic Word paragraph style, with the Style formatting over-ridden with manual formatting to produce the different heading effects; and
    • Even the manual formatting isn't consistent. If you look at the 'Employee Absences' heading, for example, you'll see that the paragraph break attached to the previous paragraph has the same formatting, as does the last paragraph in this group. Similarly, under the 'Meetings' heading, the paragraph breaks immediately before and after the 'UK' entry are formatted bold and underlined.
    These issues make it ore mdifficult than it should be to extract whatever paragraphs you want to keep, without the others. Nevertheless, the following macro should achieve what you're after:
    Please Login or Register  to view this content.
    When you run the macro, you'll be prompted for the name of the country to retain. The macro will then delete all the portions not related to that country; the major headings will remain, even if there's nothing under them for that country.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Word2007 Please help a newbie get started!

    Cross-posted at: http://www.vbaexpress.com/forum/showthread.php?t=41318

    Please read and take notice of this forum's Rule 8:
    8. Don't cross-post without a link. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post. Expect cross-posts without a link to be closed.

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Word2007 Please help a newbie get started!

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.


  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Word2007 Please help a newbie get started!

    Ok, one post, three breaches of basic courtesy forum rules.

    Closing this one down.

    llyamah, if you expect free help on this forum, I suggest you take a thorough look a the rules of conduct that apply in this community. You can find the link to the Forum Rules in the navigation bar at the top.

    regards,

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1