HowdeeDoodee
Well-known Member
- Joined
- Nov 15, 2004
- Messages
- 599
I need a macro that creates a series of fill-in-the-blank sentences or tests. The sentences without blanks are in column A. The sentences with blanks would appear in column B. The words to be blanked out in column B (replaced with an underscore line) are in column C. The rules to replace the words in the sentences in column B are as follows:
Rules:
1. Replace words in the sentences using the delete list.
2. Replace words in the sentence from left to right.
3. Replace only one word from the sentence every time the macro is run.
The macro is to be run one time creating one underscore line or blank in each sentence in column B where a delete word appears. Then the macro is to be run a second time creating another underscore line or blank in each sentence where a delete word appears. Then the macro is to be run a third time creating another underscore line or blank in each sentence where a delete word appears, and so on until I chose to not run the macro any more. If a delete word appears more than once in a sentence, only the first occurrence of the delete word is taken out until another run of the macro is made because only one word is deleted from each sentence every time the macro is run.
The sentences with words deleted would appear in column B.
Every time the macro is run, I will copy the result from column B to another sheet to store the result.
Here are before and after examples.
Before: (These sentences appear in column A.)
The cat danced all night.
The cat ate the dog's food.
The dog and the frog played the piano.
The frog and the cat jumped over the fence.
The fox ate the frog and got sick.
The cat ate a candy bar and the cat got sick.
After: In column B, macro run once results in…
The ___ danced all night.
The ___ ate the dog's food.
The ___ and the frog played the piano.
The ___ and the cat jumped over the fence.
The ___ ate the frog and got sick.
The ___ ate a candy bar and the cat got sick.
After: In column B, macro run twice results in…
The ___ ___ all night.
The ___ ___ the dog's food.
The ___ and the ___ played the piano.
The ___ and the ___ jumped over the fence.
The ___ ate the ___ and got sick.
The ___ ___ a candy bar and the cat got sick.
After: In column B, macro run three times results in…
The ___ ___ all ___.
The ___ ___ the ___'s food.
The ___ and the ___ played the ___.
The ___ and the ___ ___ over the fence.
The ___ ate the ___ and got ___.
The ___ ___ a ___ bar and the cat got sick.
After: In column B, macro run four times results in…
The ___ ___ all ___.
The ___ ___ the ___'s food.
The ___ and the ___ played the ___.
The ___ and the ___ ___ over the ___.
The ___ ate the ___ and got ___.
The ___ ___ a ____ bar and the ___ got sick.
Delete List In Column C (these are the words to be blanked out with an underscore line)
Cat
Danced
Night
Candy
Ate
Dog
Food
Frog
Piano
Jumped
Fence
Fox
Sick
Thank you in advance for any replies. Your help is appreciated.
Rules:
1. Replace words in the sentences using the delete list.
2. Replace words in the sentence from left to right.
3. Replace only one word from the sentence every time the macro is run.
The macro is to be run one time creating one underscore line or blank in each sentence in column B where a delete word appears. Then the macro is to be run a second time creating another underscore line or blank in each sentence where a delete word appears. Then the macro is to be run a third time creating another underscore line or blank in each sentence where a delete word appears, and so on until I chose to not run the macro any more. If a delete word appears more than once in a sentence, only the first occurrence of the delete word is taken out until another run of the macro is made because only one word is deleted from each sentence every time the macro is run.
The sentences with words deleted would appear in column B.
Every time the macro is run, I will copy the result from column B to another sheet to store the result.
Here are before and after examples.
Before: (These sentences appear in column A.)
The cat danced all night.
The cat ate the dog's food.
The dog and the frog played the piano.
The frog and the cat jumped over the fence.
The fox ate the frog and got sick.
The cat ate a candy bar and the cat got sick.
After: In column B, macro run once results in…
The ___ danced all night.
The ___ ate the dog's food.
The ___ and the frog played the piano.
The ___ and the cat jumped over the fence.
The ___ ate the frog and got sick.
The ___ ate a candy bar and the cat got sick.
After: In column B, macro run twice results in…
The ___ ___ all night.
The ___ ___ the dog's food.
The ___ and the ___ played the piano.
The ___ and the ___ jumped over the fence.
The ___ ate the ___ and got sick.
The ___ ___ a candy bar and the cat got sick.
After: In column B, macro run three times results in…
The ___ ___ all ___.
The ___ ___ the ___'s food.
The ___ and the ___ played the ___.
The ___ and the ___ ___ over the fence.
The ___ ate the ___ and got ___.
The ___ ___ a ___ bar and the cat got sick.
After: In column B, macro run four times results in…
The ___ ___ all ___.
The ___ ___ the ___'s food.
The ___ and the ___ played the ___.
The ___ and the ___ ___ over the ___.
The ___ ate the ___ and got ___.
The ___ ___ a ____ bar and the ___ got sick.
Delete List In Column C (these are the words to be blanked out with an underscore line)
Cat
Danced
Night
Candy
Ate
Dog
Food
Frog
Piano
Jumped
Fence
Fox
Sick
Thank you in advance for any replies. Your help is appreciated.