Excel macro loop question

Hi

What is a good way to loop through data when the keyword to end the loop may vary? See the example below. Thanks in advance for any help.

If activecell.value =“order” then
Line = “ “
Activecell.offset(1,0).active
Do
Line = line & activecell.value
Activecell.offset(1,0).active
Loop until ????
End if

The keyword will depend upon what the user entered into the order form. If a field such as donation is not entered, then it will not show up on the form. When I started coding, the form had the keyword “donation” but the next form used “address”.

Any thoughts?

By: Ellen

Leave a Reply

Your email address will not be published. Required fields are marked *