Autogenerating Code
I don't even bother with VBA (yet - I'm heading there.)
Before hand, I lay out the data tables in such a way as the whole thing will work. That's the key. You have to create a pattern and follow it. If you have your analog inputs in one order, you really should have the alarms in that same order.
Then I create one rung that references the first set of registers. Test it, debug it, test it some more.
Once I'm sure that it's what I want, I copy the ASCII string into Excel. Take the "Analog Input High" alarm in my example:
XIC B211/1 BST GRT F31:0 F215:1 NXB XIC B210/0 BND CMP F31:0 (F215:1 - F215:4) BST XIC T224:0/DN OTE B210/0 NXB TON T224:0 0.01 1 0 BND BND
Next I break it into chunks of "Fixed Text" and "Variable Addresses", and place them in different cells on the same line:
B1: "XIC B211/"
C1: 1
D1: " BST GRT F31:"
E1: 0
F1: " F215::"
G1: 1
H1: " NXB XIC B210/"
and so on.... Note the leading spaces. Very important.
Cell A1 is the contantenation of the other cells: =B1 & C1 & D1 & E1 &....
Copy line 1 to line 2, change the variables to fit whatever pattern I'm after (increment by 1, increment by 5), a few quick drags of the cells (grabbing the box in the lower right)
And presto, column A has the ASCII code, all 100 alarms.
In RSLogix, do a "Copy to Library" of the good rung, creating the .SLC. Open it up in Notepad. Delete the one rung, Select Column A in Excel, copy, paste in notepad. Save.
In RSLogix, "Paste from Library", and you're done. 100 rungs of TYPO_FREE code in about 10 minutes.
The above uses the the PLC register addresses. You can also use the technique with Symbol names. Again, pre-planning is the key. If you've got the Analog Input "TANK_LEVEL", and you just add suffixes to it, for example: the alarm enable is "TANK_LEVEL_ALM_ENA", the high limit is "TANK_LEVEL_ALM_HI_LIM", the deadband is "TANK_LEVEL_ALM_DBND", and so, you could generate you code like so:
B1: "XIC "
C1: "TANK_LEVEL"
D1: "_ALM_ENA BST GRT "
E1: "TANK_LEVEL"
F1: " "
G1: "TANK_LEVEL"
H1: "_ALM_HI_LIM NXB XIC "
etc.
Notice that column C, E, G are the same. So change them to '=C1'
If you copy this rung 100 times, and have a list of the base symbol, you can just copy that into column C (or reference it from there), and again, you're done.
The catch is that the symbol must exist in the PLC. But since you're using Excel, you can use it to create all the symbol names up front and import it.
The nice thing about using this technique is that the addresses don't matter. But you still import bug-free, annotated code in a remarkably short time.