llyamah
03-10-2012, 05:02 AM
Hello All
I'm new to the world of VBA an keen to learn. I appreciate this is a really long post but I would be so grateful for any help. Even if you can't give me any code, if you could point me in the right direction where I can learn I would be so so grateful.
I have a report at work and would really like to do things to it that would impress my manager. I have attached a sample report that follows a similar structure to the report at work.
As you will see, it has headings (in red). The report at work also has sub-headings but I have not included them here. Underneath the headings, matters for certain countries are reported. Sometimes a country will only appear underneath one heading (depending on what that country needs to report) and so the countries can differ.
Here's what I want to be able to do:
If we call this sample report a 'world-wide report'. I want to be able to split this up to create 'country specific reports'.
In an ideal world, the user will be prompted for the country that they want a report for. It needs to be quite idiot proof - so a drop-down country choice might be good (e.g. if the user is prompted to type a country, they might type 'UK' whereas all of the information is reported under 'United Kingdom' headings).
If the user selects, for example, 'United Kingdom', the code should scan the document for anything for that country and copy and paste it into a new document. The new document should omit the country headings (since the 'country specific report' is for one country only, it will not be necessary to have these) but it should include any of the red headings. If there is a red heading where nothing has been reported from that country (e.g. in the sample report, France only appears under the first red heading) then the red headings should still appear, but the words "No information to report" should be displayed.
Thank you for reading.
I'm new to the world of VBA an keen to learn. I appreciate this is a really long post but I would be so grateful for any help. Even if you can't give me any code, if you could point me in the right direction where I can learn I would be so so grateful.
I have a report at work and would really like to do things to it that would impress my manager. I have attached a sample report that follows a similar structure to the report at work.
As you will see, it has headings (in red). The report at work also has sub-headings but I have not included them here. Underneath the headings, matters for certain countries are reported. Sometimes a country will only appear underneath one heading (depending on what that country needs to report) and so the countries can differ.
Here's what I want to be able to do:
If we call this sample report a 'world-wide report'. I want to be able to split this up to create 'country specific reports'.
In an ideal world, the user will be prompted for the country that they want a report for. It needs to be quite idiot proof - so a drop-down country choice might be good (e.g. if the user is prompted to type a country, they might type 'UK' whereas all of the information is reported under 'United Kingdom' headings).
If the user selects, for example, 'United Kingdom', the code should scan the document for anything for that country and copy and paste it into a new document. The new document should omit the country headings (since the 'country specific report' is for one country only, it will not be necessary to have these) but it should include any of the red headings. If there is a red heading where nothing has been reported from that country (e.g. in the sample report, France only appears under the first red heading) then the red headings should still appear, but the words "No information to report" should be displayed.
Thank you for reading.