Apply a macro to every line of a range, skipping the lines where it fails.
3 drills
Every line, failures skipped: Register a already holds a macro that uppercases the name at the start of a setting. Run it on every line with :%normal @a. Lines it can't handle (comments) make it fail, and :normal just moves on.
Just this paragraph: Run the macro in register a on the paragraph the cursor is in, and nowhere else. Select it with vip, then type :normal @a (Vim fills in the '<,'> range).
Only the matching lines: Run the macro in register a only on the lines that contain the text that marks them (compare with the target), using :g/{text}/normal @a.