My problem is that with each subsequent iteration, the Page, Link, WebElement and CheckPoint itentifiers on lines 4 and 5 will change based on the input from line 2.
E.g. "Red" will display Page("Red Results"), Page("Red Details"), WebElement("Red2"), CheckPoint("Red3") and so on.
Is it possible to set up the script to accommodate the variation in the identifier names , etc?
I hope it isn't necessary to explicitly list the page names on lines 4 and 5
This is a big question, and the answer is pretty much the entire "Advanced QTP" course. Or most of it.
First, get rid of that checkpoint. Don't use checkpoints at all if you can avoid it. They're a pain in the backside to maintain if your application ever undergoes major changes.
Replace it with GetROProperty to get the property of whatever object you want to check. Evaluate that property using If..Then..Else and comparing against your expected results (which should probably be another column in your DataTable). Use Reporter.ReportEvent to send Pass/Fail and appropriate text to your test results. This takes a bit more time to implement than simply clicking through the checkpoint wizard, but once you're used to it, it's quick and easy and future maintenance is just a column in the DataTable.
Now it's time for a class in Descriptive Programming. Your QTP documentation has some good info, and there's lots of info on this webiste, too. Especially look at the stickied topics at the top of the QTP forum.
Line 4 would become something like this:
Browser("Browser").Page("title:=" & DataTable("ColorList", dtGlobalSheet) & " Results").Link("text:=" & DataTable("ColorList", dtGlobalSheet) & "1").Click
Line 5 went away when you stopped using checkpoints and becomes something similar to line 4, but using GetROProperty on your webelement and using descripting programming similar to what I did in line 4 to identify the right webelement.
That's a lot to digest for your first post, but hopefully this will get you started off on the right foot.
I leave you with a suggestion that QTP is a wondrous tool indeed, but you almost have to throw away everything the HP salesman told you about QTP in order to use it to its full potential. In other words, the bells and whistles and fanfare about QTP all sing the praises of the stuff that (for the most part) gets in the way of the real power of QTP. Use the bells and whistles when they're appropriate, but also learn how to script without them. Things like keywords, object repositories, and checkpoints can only go so far. And with your explanation of what you're trying to accomplish, you'll be much better off without them - and this forum will teach you how.
"The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"